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

What number is halfway between 3000 and 4000
A mountain climber camped at an elevation of 18,492 feet. the following day the climber descended 2,516 feet to another campsite. Type a numerical expression
if the slope of a position versus time graph is downward what kind of motion produced the graph
list the six enternal parts or peripherals of a computer system and identify which are output and which are input devices?
What was the original goal of the Framers when they met at Independence Hall?  How did that goal change?
Estimate 46/6,725, then find the quotient.
What factors add to get -18 and multiply to get 75?
5.815 + 6.021 as a mixed number
Sam evaluated the expression x2y for x = 7 and y = 9. He got a value of 49. Which of the following statements is correct
which term better describes political parties in american politics: division or unifying?