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

please helpppp??!!!??
In which sentence is the underlined phrase an adverb phrase
PLEASEEE HELP!!! ME Is this correct? Explain why or why not?
How do you say "goodbye" in Korean?
Write 2 to the 100th power as an exponent with a base of: 32 HELP ME!!!!!!! D: BRAINLIEST TO THE FIRST CORRECT ANSWER/ 50 POINTS!!!!!!
if you have 366 dimples on a golf ball. How many dimples are on 27 golf balls?
Q1 5^2+20 simplify this Q2 55−4⋅5+12 simplify this Q3 6^2+3^2 simplify this Q4 3^3+5⋅5 simplify this Q5 5^2−4⋅6+11 Plz dont kill me its past 4:00 pm And im too
lyis received 6 cards he received 7 fewer cards than carlos received how many cards did carlos received
some people claim that the best way to achieve the common good is for each person to work only for his or her self-interest. do you agree? why or why not?
pLeAsE hElP mE wItH mY MaTh PlEaSe LiNk AttAcHeD.