我应该如何开始 Python 我是初学者。我应该尝试什么项目或介绍视频/网站[关闭]

问题描述 投票:0回答:1

所以我开始用 python 编码,我已经完成了非常基本的编码,现在我正在更深入地学习 python。我已经开始学习这门语言,但我现在陷入了一个我不知道能走得更远的地步,但我不能回去做更多的事情,因为我已经完成了基础知识和一些中级的东西。

这是我到目前为止在 python 上完成的代码,实际上并不可怕

`TwentyOne = 21
age = int(input("how old are you? "))
if age < TwentyOne:
    kids_menu = ["Cookie", "Chocolate", "Candy"]
    print("Okay, you can have the kids menu.")
    print("The kids menu has " + ", ".join(kids_menu))
    choice = input("What would you like to order? ")
    while choice not in kids_menu:
        print("Sorry, that's not on the menu.")
        choice = input("Please choose an item from the menu: ")
    print("Great choice! Enjoy your " + choice + ".")
else:
    adult_menu = ["Steak", "Salmon", "Pasta"]
    print("Time to party!")
    print("Here's the adult menu: " + ", ".join(adult_menu))
    choice = input("What would you like to order? ")
    while choice not in adult_menu:
        print("Sorry, that's not on the menu.")
        choice = input("Please choose an item from the menu: ")
    print("Excellent choice! Enjoy your " + choice + ".")
first_name = input("what's your first name? ")
last_name = input("what's your last name? ")
print("Hello " + first_name + " " + last_name + "have a nice day")
answer = input ("how are you")
print("its good that your"+answer) 
if first_name.lower() == "bus":
    print("That's not your name.")


`
python basic replit replit-database
1个回答
0
投票

学习代码最好的方法就是开始一个项目。您想实现的目标,而不仅仅是观看视频和记忆代码。通过开始一个项目,您将有自己的问题需要解决,这意味着您不仅会提高您的编码技能,还会提高您的解决问题技能,这对大多数雇主来说更为重要。

利用你的 Python 知识,你可以尝试制作一个简单的笔记系统。它可以要求输入并在什么时候提醒您输入。然后,你必须想'哦?好吧,就目前而言,它会是:如果要求的时间是现在,那么发送/打印提醒。只要你能把你的问题解决成条件语句,你基本上可以编写任何代码^^!

当然,这只是一个项目想法,但我真的相信当您不确定如何解决您的问题时,您应该尝试自己尝试并使用 Google 和 Stack Overflow。如果你总是一步一步地跟随资源,你只是在记忆而不是完全学习我的经验。

© www.soinside.com 2019 - 2024. All rights reserved.