Skip to content

python #14

@ghost

Description

Your Name: Hajra Chughtai

Program Name: Hajra-Homework3A.py

What the program does: This program tests if a date is a Magic Date or not.

Function to check if a date is a Magic Date

def is_magic_date(day, month, year):
return day * month == int(str(year)[-2:])

Input from the user

day = int(input("Enter the day (1-31): "))
month = int(input("Enter the month (1-12): "))
year = int(input("Enter the year (4-digit): "))

Check if the entered date is a Magic Date

if is_magic_date(day, month, year):
print(f"{day}/{month}/{year} is a Magic Date!")
else:
print(f"{day}/{month}/{year} is not a Magic Date.")

input('Press Enter to exit')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions