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

What is the volume of the cone with radius 4 feet in height 10 feet round to the nearest cubic foot
What type of cells tend to be damaged the most during chemotherapy and radiation treatments? a. collagen and fibrous tissue b. epithelial cells c. nerve tissue
Thirty-five is 7/11 of what number? Plz help!! I need it solved fast
How many times a day is blood sent through the body?
Why were patents important to the development of the film industry?
What is the extension of a simple web page? A simple web page has a(n) ______ extension.
aging populations can be a problem for developing countries because
Which two nations fought The Hundred Years' War? Question 1 options: France and Italy France and Germany England and France England and Russia Question 2 (1
how do i turn 1 and 1 fith in a decimal​
(25 Points) How do taxes support the economy?