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 is the correct scientific notation for 724,000,000,000?
if the football team raises at least $5000, then they can buy new uniforms. the football team raised $5800 whats the cnclusion
What is the origin of the word renaissance? It comes from the word rebirth. It comes from the word revival. It comes from the word reason. It comes from the wo
Find the quotient. -10d 4e3f 5 ÷ 15d 2e 2f 1. 2/3 def 2. 1/3 d^4 e^3 f^2 3. -1/3 d^2 e^2 f^2 4. -2/3 d^2 ef^4
what is the square root of 1.69
Those delegates in attendance at the Convention of 1787 are often referred to as:
What is 2 1/6+3 5/6 in mathematics
What is the difference between your hometown's location and your hometown as a place?
convert 18/24 to a decimal
Which temperature scale would read the highest number for boiling water?