Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8 #Complete this code so that it creates a variable called 9 #days_between that stores the number of days between the two 10 #dates. 11

image text in transcribed
image text in transcribed
8 #Complete this code so that it creates a variable called 9 #days_between that stores the number of days between the two 10 #dates. 11 # 12 #Hint: You can find the number of days between two dates by 13 #subtracting the day number of the earlier date from the 14 #day number of the later date. 15 16 from datetime import date 17 import random 18 earlier date = date(2017, 6, random.randint(1, 25)) 19 later_date- date(2017, 6, random.randint(earlier_date.day + 1, 28)) 20 21 #Do not modify the code above! 23 24 #Write your code here! 25 26 27 #If your code is working correctly, then the following line 28 Wof code will print the correct number of dayes between the 29 two dates. Notice that this line uses commas Instead of plus 30 #signs, which is why it doesn't have to convert the dates to 31 #strings: Python does that implicitly when we use this syntax. 32 print("There are", days_between, "days between", earlier_date, "and", later_date) 22 1 #In the code below, we've created two dates. The day in each 2 #date is chosen randomly. You don't need to worry about how 3 #this works; all you need to know is that when you start 4 #writing your code, you'll have access to two variables, each 5 #holding a date: earlier_date and later_date, and later_date 6 #is guaranteed to be later than earlier date. 7 # 8 #Complete this code so that it creates a variable called 9 #days_between that stores the number of days between the two 10 #dates. 11 # 12 #Hint: You can find the number of days between two dates by 13 #subtracting the day number of the earlier date from the 14 #day number of the later date. 15 16 from datetime import date 17 import random 18 earlier_date= date(2017, 6, random.randint(1, 25)) 19 later date = date(2017, 6, random.randint(earlier_date.day + 1, 28)) 28 21 #Do not modify the code above! 22 23 24 #write your code here! 25

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Understand how emergent change occurs.

Answered: 1 week ago

Question

=+3 In what ways can an MNE improve or change its approach to IHRM?

Answered: 1 week ago