1. 程式人生 > >笨辦法學python 習題6

笨辦法學python 習題6

type_of_people = 10 #type_of_people=20 x=f"There are {type_of_people} types of people." # 定義x為格式化字串 binary="binary" # 定義字串 do_not="don't" # 定義字串 y=f"Those who know {binary} and those who {do_not}." # 給Y賦值並引用格式化字串

print(x) print(y)

print(f"I said:{x}") print(f"I also said:{y}")

hilarious="False"# 定義字串 joke_evoluation="Isn't that joke so funny?!{} "# 定義字串 print(joke_evoluation.format(hilarious))#列印格式化字串 print(joke_evoluation,hilarious) w="This is the left side of ..." e="a string with a right side."

print(w+e)