name = input("What's your name? ")
print(f"Hello, {name}!")
When this runs in a script or terminal, the prompt appears, the program pauses, the user types something, hits Enter, and the typed text is stored in name. Always as a string — even if they typed digits.
print("Hello")
print("a", "b", "c") # a b c
print("a", "b", "c", sep="-") # a-b-c
print("first")
print("second")
print("third", end=" ")
print("on the same line")
# tip_calculator.py
bill = float(input("Bill amount: "))
tip_pct = float(input("Tip percent: "))
people = int(input("How many people? "))
tip = bill * tip_pct / 100
total = bill + tip
per_person = total / people
print()
print(f"Total: ${total:,.2f}")
print(f"Each: ${per_person:,.2f}")
input("prompt: ") reads a line from the user; the result is always a string.print() can take any number of values, separated by sep=, terminated by end=.Ask the user for kilometres, convert to miles (km × 0.621), print the result.