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

h o w d o t h i s p l e a s e h a l p m e h
what effect does the first person point of view of the yellow wallpaper most likely have on the reader
After world war ii, ______ was a continued military influence on a number of islands in the pacific.
Evaluate the surface integral. s x ds, s is the triangular region with vertices (1, 0, 0), (0, −2, 0), and (0, 0, 10).
14. Compare the graphs of the inverse variations. Please provide at least 3 comparisons
What is the term for the relationship between printer and paper?
The volume of a cylindrical soup can is represented by the expression πr3 + 7πr2, where r is the radius of the cylinder. Which statement best interprets the fac
What is Biogeography the study of
One way of shooting a bow is the instinctive aiming method. what is true about this method? you look at the target with the right eye closed. you look at the ta
The school wants to buy a new speaker system for the football stadium with the money they raised from the bake sale.They compared speaker system prices from two