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

Leonard is stressed and feeling overwhelmed by the college selection process. What should he do to combat this problem? A. Go out for a hamburger, fries, and s
2.44 × 10–2 m by 1.4 × 10–3 m by 8.4 × 10–3 m
explain how sectionalism affect economics and politics in the United States today
What are three decimals between 8.6 and 9.2
NEED ASAP PLEASE !! When light is reflected by a mirror, the angle of incidence is always A. less than the angle of reflection. B. greater than the angl
How can you tell whether a scatter plot is negative, positive, or approximately zero
a parent died and left an estate to 4 children. one inherited 1/4 of the state, the second inherited 5/16 , and the third inherited 3/8. how much did the parent
what is the value of the expression 3−4 ? −181 181 −81 −12
atoms of different elements area. too hard to compare.b. exactly the same.c. different from each other.
What is 98.044 rounded to the nearest thousands