autumnnicole36582
autumnnicole36582 autumnnicole36582
  • 03-03-2021
  • Computers and Technology
contestada

How do you think we could print a sentence that uses a variable along with other text (ie: “My name is Joe” where ‘Joe’ is a variable called name.)

Respuesta :

60002135330 60002135330
  • 03-03-2021

This is for Python

name = 'Joe'

print(f'My name is {name}')

This is called string formatting. Using f before the text. This is another way

name = 'Joe'

print('My name is', Joe)

But I found that string formatting is cleaner and much more useful

Answer Link

Otras preguntas

Is 5/5 equivalent of 3/3
four babies are born at at given on a same day what is chance that two will be boys two will girls
Solve with substitution Y=x+6. Y=-2x-3
This condition can lead to heart failure and inadequate oxygenation of the brain a) Atrial fibrillation b) Ventricular fibrillation c) Tachycardia d) Bradycardi
Which sentence is grammatically correct? A.) El jugo del sandía es muy delicioso. B.)El jugo de el sandía es muy delicioso. C.)El jugo de la sandía es muy de
Which man-made features are typically parallel to the shore?A) Piers B) Breakwaters C) Groins D) Jetties
Plot the points (0, −5) and (2, 4) on the coordinate plane. (Please answer quickly this is on a important grade unit test)
8/9 whats this fraction in simplest form
When driving into fog you should: a. Use your parking lights. b. Use your high-beam headlights. c. Use your low-beam headlights. d. Turn off all lights.
A race car travels in a straight line from the starting line to the finish line in 12.0 seconds. The race car accelerated from a stopped position to 90 m/s by t