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

Change 360.439 to degrees, minutes, and seconds. A360° 55' 56' b. 360° 25' 48' C.360° 56' 80 D360° 53' 55" Please select the best answer from the choices provid
How did Elizabeth Stanton speech change people's view of our country
Jesse has three one-gallon containers. The first one has - 3/8 of gallon of juice, the second has 3/8 gallon of juice and the third has 1/8 a gallon of juice.
Convert the degree measurement to radians. Express answer as multiple of [tex]\pi = - 60 \: degrees[/tex]​
Question 4 of 10 Para viajar por avión, necesitas comprar A. un pasaporte B. un visado C. un boleto D. una puerta
what Sport is similar to Ulama
On December 30, Year 12, AGH, Inc. purchased a machine from Grant Corp. inexchange for a zero-interest-bearing note requiring eight payments of $70,000. The fir
How does the strength of a magnetic field around a wire vary?
3. ¿Qué tensiones entre los ricos y los pobres se revelan en la conversación que sostienen Raquel y Andrés?
The sum of three and five to the third power times five plus one