Question
Hello, I need help finishing up my program (code below). I need to create a function that gets the value from the function day() and
Hello, I need help finishing up my program (code below). I need to create a function that gets the value from the function day() and returns the date in the format 2/22/2050.
I have already created the function to get the value from the user. Just need another function to format the values entered to the correct date format. Please use Python, and add screenshots. Thank you.
def day():
"""Get the value from the user"""
day = input("Please enter the day ")
day_ok = False
while not day_ok:
day_ok = validate_value(day)
if not day_ok:
day = input("The value was invalid please enter again")
day_ok = validate_value(day)
return day
def validate_value(passed_value):
"""Validate weather or not the value entered is numeric"""
if passed_value:
if passed_value.isnumeric():
return True
else:
return False
else:
return False
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started