def get_descripton():
"""Return random weather,just like the pros
from random import choice
possibilities = ['rain','snow','sleet','fog
return choice(possibilities)
print("Taday's weather:" + get_descripton()) #加号
运行结果:
Taday's weather:sun
def get_descripton():
"""Return random weather,just like the pros"""
from random import choice
possibilities = ['rain','snow','sleet','fog','sun','who knows']
return choice(possibilities)
print("Taday's weather:" , get_descripton()) #逗号
运行结果:
("Taday's weather:", 'snow')