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

There are 10^9 bytes in a gigabyte. There are 10^6 bytes in a megabyte. How many times greater is the storage capacity of a 1-gigabyte flash drive than a 1-mega
Read the sentence. My brother would have worked all summer. What is the verb phrase
1. Which of the following is not a definition of an acid? A substance that increases the hydroxide ion concentration of a solution A hydrogen ion donor in a
The law that protects police officers making a traffic stop is called?
Does ejaculation fluid and pee come from the same hole female
Please help me with this question?
Abe is an excellent athlete and normally an upstanding citizen. When he went to college, his teammates were prone to aggressive acts against rival teams. One ni
Which of the following excerpts from the poem "To One in Paradise" invokes Gothic elements of the supernatural world or afterlife? A. "For love to titled age a
Is the number beside the parentheses in math part of the parenthetical grouping?
if there are 36,660 snakes (round to nearest 10) how many will there be in year 12