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

According to Renaissance philosophy, commoners often represent
During pontiacs war did France cause Indian nations to attach settlers
Keri walks her dog every morning the length of the walk is 0.55 kilometer on each weekday.on each weekend day the walk is 1.4 times as long as a walk on a weekd
In the school chorus, 2/12 of the students are fourth graders. In simplest form, what fraction of the students in the school chorus are fourth graders?
The stable platform has developed from a series of _____.
Carbohydrates are built up from their basic building blocks by the
What is europes smallest and most crowded county?
Identify the​ subject(s) of the following sentence. In the desk drawer are a tablet of paper and some pens. A. ​paper, pens B. paper C. drawer D. ​tablet, pens
What is -0.8a-8=0.2a ?
Find the missing number in the pattern. 1, 12, 23, _____, 45, 56 a. 31 b. 34 c. 37 d. 42