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

Solve 6.25, -√(25, π, 10/3, √15 least to gratest
60+42.95x=25+49.95x value for x
9. Name an object that has a great mass but has a small volume.
Evaluate 6y + x9 When x = -5, y = -4
cual es el ambiente físico y el ambiente psicológico. de los tres estudiantes
a simply stated what will be observed and always true, but does not explain why.
Determine the slope intercept form of the linear equation x/2-y+6=0
FAST PLZZ!! -Another name for dash lights is _______. A. vehicle problem indicators B. vehicle warning indicators C. vehicle status indicators D. vehicle ca
Which word from the sentence helps you understand the meaning of the word interact? a. contrast b.talk c. probably d. require
Write -3.5 as a mixed number. ​