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

Find the inverse of f (x)=log(subscript 4) x
This weekend you are planning to complete part of your assignment at the library to do this you need to store data on a removable storage device
Can someone help with question 51 please I need to break it down
Which statement about the Sacco-Vanzetti trial of 1921 is true? A. Many people believed they were convicted solely because they were anarchists. B. The evidence
A coat regularly sells for $59.00. It is on sale for 20% off. What is the sale price of the coat?
Could someone who knows french help me write a past holiday paragraph??
on what continents would you expect to see evidence of a glacier
There are 34 adults and children13 on tour how much money will the group save by visiting the main deck of the observation tower instead of the top deck explain
What is the capital of Maine
The remainder when x^3 - 11x + 10 is divided by (x+3) is A 52 B 16 C 4 D -24 I was doing a past paper and came across this,I know one (long) way of