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

WILL GIVE BRAINLIEST IF ANSWERED FAST!!!
definition of populism​
Name of the polynomial expression: -8
If two sides of a triangle measure 2 and 4, what might the third side be?
(6x-1) (6x-1) -x + 3 (x+5) - 7x(x)
how are vitamins or supplements good for your health
The Royal Botanical Gardens at Kew were famous because they were designed by a king. - True - False Answer: False (edg 24')
A sample of a radioactive isotope had an initial mass of 110 mg in the year 1990 and decays exponentially over time. A measurement in the year 1993 found that t
WILL GIVE BRAINLIEST IF ANSWERED FAST!!!
The population of rabbits on an island is growing exponentially. In the year 1990, the population of rabbits was 2100, and by 1993 the population had grown to 3