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

The planet we call earth has how many layers
name the biome that has nutrient rich soil and is most often used for agriculture
Are pencils biotic or abiotic because its not living but it was made out of wood which was a live
Which answer offers the best explanation for why Tecumseh fought alongside the british in the war of 1812? A. Tecumseh and his tribe were paid well by British g
As more matter gets packed into the same amount of space what happens to the materials density
What is the city-state of Athens sometimes called?
Round 19.3 to the nearest whole number
-3/5x+y=-4 What is the slope-intercept form? I'm in 7th grade.
the shaded rectangle shown below is a scale drawing of a rectangle whose area is 288 scale feet. what is the scale factor of the drawing?
Help please Solving Systems Using Inspection How many solutions does this system of equations have? A. none B. exactly one C. exactly two D. infinitely many