Write a Python program that keeps a number from the user (between 1 and 7) and displays the name of the weekday. Example : Input number: 3 Output : Wednesday

  • برمجة بايثون

Write a Python program that keeps a number from the user (between 1 and 7) and displays the name of the weekday. Example : Input number: 3 Output : Wednesday

الأجوبة

lst = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]

n = int(input("Input number: "))

if n>=1 and n<=7:
    print(lst[n-1])

else:
    print("Invalid input")
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...