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

~ALGEBRA! PLEASE HELP!~ Austin is climbing on a ladder that is attached against the side of a jungle gym wall. He is 5 feet off the ground and 3 feet horizontal
3/8 divided by 1/2 =
what r some facts about gymnosperms
In the figure, a ‖ e, m ‖ n, and m∠3 = 108° What is m∠6? __ °
The Emergency Highway Energy Conservation Act was passed in 1974. Under this act, states would only get federal highway funding if they set a speed limit of 55
Four more than the product of 23 and Gregs height. Use the variable g to represent Gregs height
Solve by substitution X+3y=1 and -3x-3y=-15
what was unknown in europe before european explorers visited the americans
name three way the hopi adapted to the dry climste of the southwest
In the figure, a ‖ b and m∠1 = 34°. What is m∠7? __ °