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

Jones company is a perfectly competitive firm. the market price of its output is $10. the firm is currently producing 50 units of output. at this level of outpu
Complete the sentence to show the distributive property of 7x6=
Why doesn't sodium bromide conduct electricity when solid?
I need help on this i have no clue what to do !!!!! Consider all the sources of water listed on the three bars in the graph from the resource site. *Questions
Ways to prevent ostioporosis
Drug use is bad for society how can this thesis statement be improved
Which best defines a dynamic character A. Dynamic characters are always the bad guys. B. The dynamic character is the most important character in the story. C.
5.97x10-^24-7.34x10^22 Show all work please
What 2 numbers multiplied together equals 20 and add up to 19
a cookie factory uses 1/10 of a bag of flour in each batch of cookies. the factory used 1/2 of a bag of flour yesterday. how many batches of cookies did the fac