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

Who is George Washington
How long did the Egyptian civilization last? What years?
The Spanish who lived and worked in missions often forced Native Americans to
The continuous removal and replacement of organic molecules in a cell are part of the process of
what is the radius for 439.6 circumference
x y 1 12 5 40 10 50 15 170 20 280 25 410 What is the curve of best fit for the data shown? A) y = 16x2 - 51x + 9 Eliminate B) y = 0.2x2 + x + 23 C) y = 10x2
What were three ways southerners tried to disrupt african americans from voting?
Does it say anywhere in the bible that you should not eat frog legs
What is the verbal expression of |8-9|+5
Is 25 a perfect cube?