Jul-24-2021, 05:52 PM
(This post was last modified: Jul-24-2021, 06:34 PM by Yoriz.
Edit Reason: Added code from link into code tags
)
Hi, I made post before ( dont mind it, it was when i just started ).
I have a question:
how to print the day in english if i have a date ( input date ).
I managed to do this, but it was long and i cant think that there is a solution way easier and shorter than this..
i need to write in english the day.
how to make it shorter + how to import the date in number to date in english?
i answered for it correctly ( as you can check there ), but its long and slappy...
I have a question:
how to print the day in english if i have a date ( input date ).
I managed to do this, but it was long and i cant think that there is a solution way easier and shorter than this..
i need to write in english the day.
import calendar year = int(input("Please choose your year: ")) month = int(input("Please choose your month: ")) day = int(input("Please choose your day: ")) print(f"Please enter a date: {day}/{month}/{year}") calendar = calendar.weekday(year, month, day) print(f"The day of the week is: {calendar}") if calendar == 0: print("Day of the week in english is Monday") elif calendar == 1: print("Day of the week in english is Tuesday") elif calendar == 2: print("Day of the week in english is Wednesday") elif calendar == 3: print("Day of the week in english is Thursday") elif calendar == 4: print("Day of the week in english is Friday") elif calendar == 5: print("Day of the week in english is Saturday") elif calendar == 6: print("Day of the week in english is Sunday")the link shows the code
how to make it shorter + how to import the date in number to date in english?
i answered for it correctly ( as you can check there ), but its long and slappy...