Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update errors.py #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions errors.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# errors.py is based on dateconvert2.py from Chapter 5 of the Zelle textbook
# Converts day month and year numbers into two date formats

def main()
def main():
# get the day month and year
day, month year = eval(input("Please enter day, month, and year numbers: ")
day, month ,year = eval(input("Please enter day, month, and year numbers: "))

date1 = str(month)"/"+str(day)+"/"+str(year)
date1 = str(month)+ "/"+str(day)+"/"+str(year)"

months = ["January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December"]
monthStr = months[-1]
date2 = monthStr+" " + str(day) + ", + str(year)
monthStr = months[month-1]
date2 = monthStr+" " + str(day) + "," + str(year)

print("The date is" date1, "or", date2+".")
print("The date is," date1, "or", date2+".")

main()