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 7r+ 2 = 5(r – 4) ​
I need help, please & thank you
Of the roles commonly found in the development, maintenance, and compliance efforts related to a policy and standards library, which of the following has the re
What is the impact on human health as we try to stay ahead of the evolutionary process?
A 20.0 cm tall object is placed 50.0 cm in front of a convex mirror with a radius of curvature of 34.0 cm. Where will the image be located, and how tall will it
Which two countries signed the Limited Test Ban Treaty in 1963? France Germany United States Great Britain China
Consider the equation below. (If an answer does not exist, enter DNE.) f(x) = e8x + e−x (a) Find the interval on which f is increasing. (Enter your answer using
segment DB is a median of ΔADC. Which statement best describes the relationship between triangles ABD and CBD? A. Triangles ABD and CBD are congruent by the SSS
What is the electoral college?
how much is 2 plus 9​