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

Which book is recorded as the tallest in the Library of Congress?
What role did the military play in many Latin American countries during the 1920s and 1930s? Use specific examples to support your answer.
Which change is exothermic? (1) freezing of water(2) melting of iron(3) vaporization of ethanol(4) sublimation of iodine
Trapezoid WKLX has vertices W(2, −3), K(4, −3), L(5, −2), and X(1, −2). Trapezoid WKLX was reflected across the y-axis to produce trapezoid WꞌKꞌLꞌXꞌ. Which coor
The gram formula mass of NH4Cl is(1) 22.4 g/mole (3) 53.5 g/mole(2) 28.0 g/mole (4) 95.5 g/mole
the month budget for the front of the house is $9000. You spent 6% of the budget on fresh flowers. How much did you spend on fresh flowers?"
Which element is malleable and a good conductor of electricity at STP? (1) argon (3) iodine (2) carbon (4) silver
At standard pressure, hydrogen peroxide, H2O2, melts at -0.4°C. boils at 151°C, and is very soluble in water. A bottle of aqueous hydrogen peroxide, H2O(aq), p
What is the total number of electrons in a Mg2+ ion?(1) 10 (3) 14 (2) 12 (4) 24
how did Romans learn the written language