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

Mila has 100 math problems to finish this week. She solved 2/10 of the problems on monday and 25/100 on tuesday. Which day did she solve more problems?
What age can a child sit in the front seat?
how does trade with other nations affect India
What is m∠DBC if m∠DBA = 85°? A. 23° B. 20° C. 31° D. 147°
PLEASE ANSWER I AM USING THE LAST OF MY POINTS FOR THIS!!!
Why are the elements 57 through 70, and 89 through 102, found separately at the bottom of the Periodic table?
Use fraction strips to help you complete the number line then locate and draw a point for the fraction 1/3
How many people can lift a 30g stone?
❤❤❤PLEASE HELP I WILL MARK BRILLIANT WHOEVER ANSWERS THANKS (:❤❤❤ 1. Why does the speaker of “Thumbprint” compare her thumbprint to her signature? (1 point)
Imagine you are creating a travel brochure about the "perfect" United States. One thing you probably would not show is _____. young children in school men and