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 rearrangement of drehenbell​
themes of expressionism
When considering a career as an art director, which aspects of the job might be most challenging to a trained artist? (Select all that apply.)
Assume that women’s heights are normally distributed with a mean given by μ=63.5in, and a standard deviation given by σ=3.1 in.a. If 1 woman is randomly selecte
Write an equation of the line with a slope of ( and y-intercept of 5. Answer please
why Jewish people have been presecuted throughout history?*12 marks question* ​
neeed hellpp quickkk
What is the value of (3x10^-2)?​
The number of DVDs shipped to an online retailer was 15,000 less than the previous year. Use an integer to describe the change in the number of DVDs shipped. T
Solve this please. It's bit confusing.​