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

Use the net to find the surface area of the prism.
find the inverse of f(x)=2x-5​
The function V(r)=4/3 nr3 can be used to find the volume of air inside a basketball given its radius . What does V(r) represent? Can someone help me out?
a volleyball reaches its maximum height of 13 feet 3 seconds after its served which of the following quadratics could model the height of the volleyball over ti
Who confirms Supreme Court nominees?
PLEASE HELP Why is essential that the elements such as fonts, colors, visual structure, graphics, and the interface of a web page should complement eachother?
Find the rate of change. Find the slope of the line Find the rate of change
What was the result of the battle of Tippacanoe
What is the solution of the system? Use elimination. 7x+5y=19 -7x-2y=-16 A. (–2, –1) B. (–2, 1) C. (2, 1) D. (2, –1)
tattoo how is it made