4.1.4 String Concatenation & Repetition

Unit: Unit 4: Strings, Lists, and Tuples • Interactive Practice

Quick Answer & Summary:

Interactive Python programming tutorial and practice in your browser.

Interactive Challenge (Run Live in Browser):

# Practice concatenation (+) and repetition (*)
first_name = "Grace"
last_name = "Hopper"

# 1. Concatenate with a space separator
full_name = first_name + " " + last_name

# 2. Create a divider line repeating "=" 20 times
divider = "=" * 20

print(divider)
print("Pioneer:", full_name)
print(divider)
Open in Live Interactive Python Sandbox →