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

slove the system of equations 3x-7y=5 and 9y=5x+5
After ww2, european powers focused on repairing their own countries. eventually, the middle east __________ themselves from imperial control.
Need help on geometry please
Why do the gulag guards want to frighten the people they arrest?
What impact did the atlantic slave trade have on the nations of the west african interior?
How could an indicator be used to find out something is acidic or alkaline if the label was missing?
Explain why lithium is a strong reducing agent, whereas fluorine is a strong oxidizing agent.
Keegan and Iris are learning about examining the animal's hair coat. Keegan says the hair coat should be examined for brittleness and alopecia. Iris say the hai
If lava flows through a forest, will the trees A) Become petrified. B) Burn
What are the parallels between the Patriot movement and the movement to free slaves?