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

Put the events in proper chronological order, from earliest to latest. A. World War I ends, 19th amendment passed, Model T produced B. 19th amendment passed, Mo
Give the excluded values for 6/t+5 + 2/t-5 = 3t-1/t^2-25. Do not solve A)25 B)-5,5 C)5,25 D)-5,5,25 Please help i don’t understand
Read and match the sentences or expressions that make the MOST sense together
what are the 6 different sections of the cpt code set? provide an explanation of the healthcare encounters that are coded with each section, name at least 2 sep
Is the following sentence grammatically correct or incorrect Souvent, je réponds aux questions du professur
Can somebody plz help me [-5+(-7)]^2-(7+3)^2
What does PC stand for?
find the area of a sector of a circle with radius 6 centimetre if angle of sector is 60 degree​
At the toy store, you could get 4 board games for $25.84. Online, the price for 5 board games is $32.15. Which place has the highest price for a board game?
Please summarize the following... On July 13th, a federal judge permanently blocked Georgia’s recent heartbeat law from going into effect. The law would have pr