Answer:
def leap_year(y):
if y % 4 == 0:
return 1
else:
return 0
def number_of_days(m,y):
if m == 2:
return 28 + leap_year(y)
elif m == 1 or m == 3 or m == 5 or m == 7 or m == 8 or m ==10 or m == 12:
return 31
elif m == 4 or m == 6 or m == 9 or m == 11:
return 30
def days(m,d):
if m == 1:
return 0 + d
if m == 2:
return 31 + d
if m == 3:
return 59 + d
if m == 4:
return 90 + d
if m == 5:
return 120 + d
if m == 6:
return 151 + d
if m == 7:
return 181 + d
if m == 8:
return 212 + d
if m == 9:
return 243 + d
if m == 10:
return 273 + d
if m == 11:
return 304 + d
if m == 12:
return 334 + d
def days_left(d,m,y):
if days(m,d) <= 60:
return 365 - days(m,d) + leap_year(y)
else:
return 365 - days(m,d)
print("Please enter a date")
day=int(input("Day: "))
month=int(input("Month: "))
year=int(input("Year: "))
choice=int(input("Menu:\n1) Calculate the number of days in the given month.\n2) Calculate the number of days left in the given year.\n"))
if choice == 1:
print(number_of_days(month, year))
if choice == 2:
print(days_left(day,month,year))
Explanation:
Hoped this helped
Answer: I a reference to the next node
III a data element
Explanation:
A linked list is simply referred to as a linear data structure, whereby the elements would not be stored at memory locations that are together in the sequence.
In simple words, we can simply say that a linked list is made up of nodes in which, every node has a data element and also a link or reference to the next node that is in the list.
Therefore, based on the explanation above, the correct option will be:
I. a reference to the next node
III a data element
Answer:
1/3
Explanation:
T₁ , T₂ , be the arrival times of two customers.
See expected time for the earliest and latest below.
The formulas used will guide you.
Answer:
The advantage for the above condition is as follows:-
Explanation:
- If a user creates a defined constant variable and assigns a value on its and then uses that variable instead of the value, then it will a great advantage.
- It is because when there is a needs to change the value of that variable, then it can be done when the user changes the value in one place. There is no needs to change the vale in multiple places.
- But if there is a value in multiple places instead of a variable and there is no constant variable, then the user needs to change the value in multiple places.
<span>The Windows 98 operating system contains approximately 13 million lines of code.</span>