في هاذا المشرع استخدمت مكتبتين مكتبة ال(datetime and time)
و المشرع جداً سهل و شرح سهل اتمنى يعجبكم
الكود:
import datetime
import time
def main():
name = input("Enter yor name: ")
time.sleep(2)
print("Hello " + name)
time.sleep(1)
age = int(input("Enter your year of birth: "))
YearNow = datetime.datetime.now() .year
MyAge = YearNow-(age)
time.sleep(3)
options = int(input(f"oh your age is {MyAge} Year \n like me I am {MyAge} \n my name is 'Fbot' \n Check one of the options {name} \n 1- for python \n 2- for HTML \n 3- for JavaScript "))
print(options)
if options == 1:
print("Python is an extensible,\n high-level, easy-to-learn, open-source,\n object-oriented programming language. \n'Wikipedia'")
elif options == 2:
print("Hypertext Markup Language,\n is a markup language used to create and design web\n pages and websites, and this language is\n considered one of the oldest and most widely \nused languages in web page design.\n 'Wikipedia'")
elif options == 3:
print("JavaScript or JS is a high-level programming language \nused primarily in web browsers \nto create more interactive pages.\n It is currently being developed by Mozilla Corporation.\n 'Wikipedia'")
else:
print("Error")
main()
ليست هناك تعليقات:
إرسال تعليق