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

A box of mass 8.0 kg is lifted from the ground and placed on a shelf. The box gains 100J of potential energy. The box falls off the shelf. Air resistance can be
Glaucoma is a disease of the eye that is manifested by high intraocular pressure. The distribution of intraocular pressure in the general population is approxim
HELP SOLVE THANK YOU!
make a graphic organizer
Spell all words correctly. Ben knows that procedural programming structures a computer program as a set of computational steps consisting of computer code that
which animlal is the only livung descendent of the dinosours
Why do you think that most DNA is stored in the nucleus of a cell and NOT in the cytoplasm?
For 1.8 hours, Layla drove her car east at a constant velocity. In this time, she drove 99 kilo meters and passed a motorcycle that was driving at 45 kilo meter
If you give them enough time, they will reveal their secret themselves. Which of the underlined words in the sentence is a possessive case pronoun?
The diagram shows a prisim Draw the front elevation and the side elevation of the prism on the grids.use a scale of 2 squares to 1m​