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

A 25.0 kg child on a swing kicks upward on the downswing thus changing the distance from the pivot point to her centre of gravity from 2.40 m to 2.28 m. What i
what two canadian provinces border Alaska?
What is the position of 7 in the number 876,543?
In the late 20th century , the green revolution had the greatest impact on
Why do many different types of proteins exist even though there are a limited number of amino acids
the difference of 17 and 5 times a number.
there are two trains A and B. which are 30 kms apart. both the trains are moving towards each other with velocity of train A is 40 kms / hr velocity od train B
there are two trains A and B. which are 30 kms apart. both the trains are moving towards each other with velocity of train A is 40 kms / hr velocity od train B
List three examples of a primary economic activity?
The digit in the tens place of a two digit number is three times that in the units place. If the digits are reversed the new number will be 36 less than the ori