cars=['audi','bmw','subaru','toyota']
for car in cars:
if car=="bmw":
print(car.upper())
else:
print(car.title())
car='subaru'
print("Is car=='subaru'? I predict True.")
print(car=='subaru')
age=17
if age>=18:
print("You are old enough to vote!!!")
print("Have you registered to vote yet?")
else:
print("Sorry,you are too young to vote.")
age=12
if age<4:
print('免费')
elif 4<=age<=18:
print("请缴费25美元")
else:
print("请缴费40美元")
favorite_fruits=["苹果","橘子","香蕉"]
if "苹果" in favorite_fruits:
print("you really like 苹果")
if '橘子' in favorite_fruits:
print("you really like 橘子")
if '香蕉' in favorite_fruits:
print("you really like 香蕉")
requested_toppings=[]
if requested_toppings:
for requested_topping in requested_toppings:
print(f"adding {requested_topping}.")
else:
print('Are you sure you want a plain pizza')
alien_0={'color':'green','options':5}
print(alien_0['color'])
print(alien_0['options'])
alien_0['x_position']=0
alien_0['y_position']=25
print(alien_0)
|