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

1,870 /210 = x what is x?
Devon and Aimee are creating model volcanoes for their science project. Devon’s volcano has a radius of 3.5 inches, and a volume of approximately 89.80 cubic in
What were nations that joined the Allied Powers during World War 1? What were nations that joined the Axis powers during World War 1? What was the private compa
Why were the Southern States concerned with the extension of slavery in the new territories?
explain the impact of the magna carta
Which of the following individuals actually signed the Magna Carta? B. King George A. King John D. Thomas Jefferson C. Ben Franklin​
What is the chemical formula of CuH10N2O11.
what fractions are equivalent to these fractions 4/5= 3/8= 1/6=
Explain how materials enter and leave the cell. Make sure you use some terms like diffusion, osmosis, active and passive transport.
The Perseverance rover will NOT ____. A. allow scientists to study how spacesuit materials hold up on Mars B. explore a crater experts think once held a lake C.