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

Which line best shows person versus nature conflict? Select one As the doors creaked open the sun s rays almost blinded him Phaethon stood impatiently at the he
Sinxcosxtanx=1-cos^2x
which describes how mrna is used by a cell
What do you mean by RFP in Transportation ? Why it is important?​
The reemergence of the deadly disease did not stop people from returning to the city. It did, however, leave a lingering sense of helplessness. Well into Decemb
What is the maximum number of possible solutions for the system shown below? х2 – 4у2 = 16 x2+y2 = 36 А. 2 B. 4 C. 3 D. 1
On January 1, 2011, Ozark Minerals issued $10 million of 9%, 10-year convertible bonds at 101. The bonds pay interest on June 30 and December 31. Each $1,000 bo
What are the coordinates A' B' C' and D' after dilation with a scale factor of 2? Pre-image coordinates are: A(-2,-1) B(1,-1) C(1,-3) D(-2,-3)​
what is the mode of 82 , 79 , 72 , 72 , 81 , 77 , 69
What was the title given to the leader of Russia in the period before the revolution?