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

Solve for x 4 to 6 = x to 18
__________ contain all nine essential amino acids.
Climatology is a subspecialty of A. meteorology. B. environmental science. C. oceanography. D. marine 8.
What makes you feel empowered in the workplace?
The ratio of white marbles to blue marbles in Connie's bag of marbles is equal to 2:3.There are more than 20 marbles in the bag. What is a possible number of wh
__________ is a state of physical and emotional exhaustion that includes a hopeless feeling, chronic fatigue, and low energy.
The right to vote is called ?
which is a reason democracy failed following most latin american revolutions
People express thoughts mainly by using A. pictures. B. numbers. C. gestures. D. language.
What would the weight of an astronaut be on Saturn if his mass is 68 kg and acceleration of gravity on Saturn is 10.44 m/s2? Please explain.