Run Program ❯
Python Home
❯
Run Code
Change Orientation
# Using + operator first_name = "John" last_name = "Doe" full_name = first_name + " " + last_name print("Full Name (using +):", full_name) # Using join() method words = ["Python", "is", "awesome"] sentence = " ".join(words) print("Sentence (using join):", sentence) # Concatenating strings and numbers (using str()) age = 25 message = "Age: " + str(age) print(message) # Using f-strings (Python 3.6+) greeting = f"Hello, {first_name} {last_name}. You are {age} years old." print("Greeting (using f-string):", greeting)