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

what is 2096 to the nearest thousand
PLEASE ANSWER ASAP!!!!!!!!!!!!!!! The perimeter of a rectangle is at most 80 inches. The length of the rectangle is 25 inches. The inequality 80 - 2w > 50 ca
Which of the following describes an achievement of the Sumer civilization? A. The establishment of social equality for all men and women B. The development of t
Why were the French and the British having a conflict over the Ohio river valley?
Video-sharing sites such as youtube and vimeo provide a place to post short videos called clips, true or false?
Solve 247 divided by 10 to the 3rd power + 247 divided by 10 to the third power
what is the percentage of 15 out of 75
What is the mass of a truck if it produces a force of 14,000n while accelerating at a rate of 5m/s?
is 6.52 grater then 6.520
If x=2a-b2 then a =