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

mr. Robbins has $2,730 in his checking account and $11,019 in his savings account. Round to the nearest hundred and add to find about how much money he has in b
Solve for x. 4x-5/y=2z
5/8 is less or more than 2/3
What's 7/8x4/5? Cmon peeps it's hard
How has the U.S. Fish and Wildlife Service positively impacted ecosystems?
The federal ________ is made up of all executive branch employees. a. assembly b. bureaucracy c. cabinet d. committee
break apart and distribute to solve 72÷8 72÷8=(40÷8)+(____÷8) =5+____ =_____
Where might a slave captured farther south along the African coast, in the equatorial regions (around the equator), most likely have been shipped? A. North Amer
What can government do to reduce unemployment?
what are 2 important jobs of photosynthesis