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

use prime factorization to find the square root of 504
What is true about the stock market? A. Investors always make money from investing in the stock market B. All stock markets feature physical location based au
can someone please solve the problems below I have no idea how to do them and my teacher's canceled all classes this week so I Have no way of knowing
how many times does 78 go into 171
A person who studies,describes and explains the past
Please write the following sentence using double object pronouns. Mi abuela me manda una carta cada semana. (My grandma sends it to me every week.)
How many weeks until all 350 rhinos disappear?
Three friends each have some ribbon. Carol has 90 inches of ribbon, tino has 13.5 feet of ribbon, and baxter has 1.5 yards of ribbon. Express the total length o
Why was the decision made to use the atomic bomb on Japan?
What does a liquid with more H+ ions than water produce?a: pH above 7b: basec: alkalined: acid