%s - String Formatting

%s
Β 
reservesΒ 
aΒ 
placeΒ 
forΒ 
theΒ 
variablesΒ 
thatΒ 
holdΒ 
theΒ 
valueΒ 
toΒ 
beΒ 
insertedΒ 
inΒ 
theΒ 
string.
print("String %s " %variable_name)
fruit = "apples"
print("Get me %s." %fruit)

f - String formatting

f-strings
Β 
areΒ 
anotherΒ 
wayΒ 
toΒ 
useΒ 
variablesΒ 
insideΒ 
aΒ 
printΒ 
statement.
YouΒ 
canΒ 
startΒ 
theΒ 
printΒ 
commandΒ 
withΒ 
anΒ 
f,Β 
andΒ 
whereverΒ 
{Β 
variableΒ 
}
Β 
bracketsΒ 
areΒ 
used,Β 
theΒ 
valueΒ 
ofΒ 
theΒ 
variableΒ 
isΒ 
insertedΒ 
there.
print(f"string {variable_name}.")
name = "Zog"
age = 40
print(f"Hello, {name}. You are {age}.")

Input Function

TheΒ 
input()
Β 
functionΒ 
allowsΒ 
theΒ 
userΒ 
toΒ 
enterΒ 
aΒ 
valueΒ 
thatΒ 
getsΒ 
storedΒ 
inΒ 
aΒ 
variable.
input("message to be shown in input prompt")
x = input("Enter your name:")
print("Hello, " + x)