Guest User

Untitled

a guest
Oct 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. print("hello, your name is [name]")
  2.  
  3. print("hello, your name is "+name)
  4.  
  5. >>> name = 'Jake'
  6. >>> print('hello %s, have a great time!' % name)
  7. hello Jake, have a great time!
  8.  
  9. >>> print('hello {}, have a great time!'.format(name))
  10. hello Jake, have a great time!
  11.  
  12. >>> print('hello ' + name + ', have a great time!'.format(name))
  13. hello Jake, have a great time!
  14.  
  15. >>> print(f'hello {name}, have a great time!')
  16. hello Jake, have a great time!
  17.  
  18. print(f"hello, your name is {name}")
  19.  
  20. print('Hello, my name is {0}, and here is my name again {0}'.format(name)'
  21.  
  22. print(f'your name is {name}')
  23.  
  24. print('your name is {}'.format(name))
  25.  
  26. >>> print("%s, your name is %s" % ('hello', 'name'))
  27. hello, your name is name
Add Comment
Please, Sign In to add comment