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 roof of a house rises 9 ft over a run of 12 ft. Determine the height of a vertical brace placed 8 ft from the low end of the roof.
Fill in the blank with the correct form of payer. Check all correct answers. Je _____ la viande. A. paies B. paye C. payé D. paie
Looking at the graph (photo attached), what is the independent and dependent variable?
definition of radical ​
Please help!!!! Write the equation of the circle in general form. Show all your work
how is the sun bigger from the moon​
Pls how can I write an email ​
HELP FAST PLEASE! What is the limiting reactant if 43.4 g of NH3 react with 30 g of NO? The balanced equation is 4NH3 + 6NO --> 5N2 + 6H2O.Choices:A. H2OB. N
After reviewing your food log, what is a conclusion you can make about your food choices?
Marco Company shows the following costs for three jobs worked on in April. Job 306 Job 307 Job 308 Balances on March 31 Direct materials used (in March) $ 26,00