from datetime import date, timedelta
import os
os.system('cls')
def date():
s = input("Write 1 for today, 2 for yesterday and 3 for random date: ")
if s == 1:
last_date = (date.today())
link_today = "https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY&date=" + str(last_date)
return link_today
elif s == 2:
yesterday = print(date.today() + timedelta(days=-1)
return yesterday
date()