Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import datetime
  2. today = datetime.date.today()
  3. delivery_date = input("Tell me your deadline on the next format (dd/mm/aa): ")
  4.  
  5. print("n")
  6.  
  7. deadline = datetime.datetime.strptime(delivery_date, "%d/%m/%y").date()
  8. days = delivery_date - today
  9. print("You have", days.days, "days to finish your project.")
  10.  
  11. weeks = days // 7
  12. remainder_days = days % 7
  13. print("You have", weeks.days, "weeks and", remainder_days.days, "days.")
  14.  
  15. remainder_days = dias % 7
  16. TypeError: unsupported operand type(s) for %: 'datetime.timedelta' and 'int'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement