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

Order these numbers from least to greatest. 7.987, 8.4082, 8.8, 8.48
Which sentence has an inappropriate shift in number? Scott and Julie showed the judging panel their science fair project. If my friend calls, tell them I'm at m
key is used to enter commands or to move the cursor to the beginof the next linea) Delete keyb) Shift keyc) Ctrl keyd) None of these​
HEY CAN ANYONE PLS ANSWER DIS SPANISH WORK!!!!!!
Which of these is not a characteristic of poetry? Select one: O Lines and stanzas O Figurative Language O Lines and paragraphs O Sound Devices​
How would you categorize the following claim from the article “The Controversy Surrounding School Gardens”? Opponents think that “foodies,” people who are stron
The equation of line CD is y = 3x - 3. Write an equation of a line perpendicular to line CD in slope-intercept form that contains point (3,1). Oy = 3x + 0 Oy =
Why do we celebrate black History Month?
What region was most affected by the Dust Bowl?
Which elements had only one valence electron?