حكمه

""ليس هناك تحدٍ أكبر من تحسين ذاتك وتطويرها. تصرَّف كما لو أنّه من المستحيل أن تفشل. إذا كنت تستطيع تخيل صورة ما فذلك يعني أنّه يمكنك أن تجعلها واقعاً، وإذا كنت تستطيع أن تحلم فهذا يعني أنّك تستطيع تحقيق حلمك.""

الأحد، 3 يوليو 2022

الرئيسية مشروع Python يحسب العمر بسهولة | Python project calculates age with ease

مشروع Python يحسب العمر بسهولة | Python project calculates age with ease





 في هاذا المشرع استخدمت مكتبتين مكتبة ال(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()


شرح الكود بالفيديو

ليست هناك تعليقات:

إرسال تعليق

حقوق الطبع والنشر محفوظة لمدونة حاسوبي. يتم التشغيل بواسطة Blogger.