我的任务:
Create a menu option which makes the bot print the date and time of today, a random mood, an integer and a float. Everything should be put together in a string sentence.
这是我到目前为止得到的,我认为我应该用的。问题是我不知道怎么把它们放在一起。你知道吗
def dateandfeels():
"""
docstring
"""
today = (time.strftime("%H:%M:%S"))
time1 = (time.strftime("%d/%m/%Y"))
whole = int(15)
float1 = float(0.056)
mood = ['happy', 'sad', 'moody', 'pythonic']
moody = (random.choice(mood))
print("""Today is {today}. Time is {time1}. My number of choice is {whole}
and my float of choice is {float1}. Also I'm feeling a bit {moody} today""")
如果有人能提供一些帮助或提示如何让这个进行我将不胜感激。你知道吗
如果我理解你,你就需要这样的东西,对吗?你知道吗
首先我将所有变量添加到字符串中,然后打印它,另一种方法是打印任何类型的变量,对吗?你知道吗
相关问题 更多 >
编程相关推荐