# basics variables

String Operators: +, *, and len()

You already know + joins strings together. Two more tools work great with strings:

  • * repeats a string a number of times, with no extra spaces added
  • len() gives back how many characters are in a string
word = "ha"
print(word + "!")
print(word * 3)
print(len(word))

prints:

ha!
hahaha
2

Your turn: read a word. Print the word with ! added on the end (using +). Then print the word repeated 3 times with no spaces (using *). Then print the word's length using len().

💡 need a hint?

pyb-var-string-ops.py🔒 given lines are locked — write your code in between
loading...