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

Using the linear equation 3x+2y=6, express x in terms of y
What role did Leland Stanford play in the construction of the railroad?
students with work study jobs are paid at least once every___?
Which letter on the map marks where the Anasazi culture was located?
Which sentence uses the correct form of interesting to make a comparison? That's the most interestingest book I've ever read. That's the most interesting
Would anyone be able to do a math paper for me?
Which word is an exaplme of an iamb? A. Daybreak B. Clever C. Happy D. Inspire
Explain why aldehydes and ketones react with a weak acid such as hydrogen cyanide but do not react with strong acids such as hcl or h2so4 (other than being prot
Which is the equation of the porabola with focus of (0,5) and directrix x= -5?A) x^2 = -5yB) x^2 = 5yC)x^2 = 10yD)x^2 = 20yPlease and thank you!
why do you brush your teeth the same way every time​