Answer:
Heyy I'm feeling sad and stressed. Wbu?
Explanation:
Answer:
Explanation:
The code does not fail on the first step since 1900 divided by 4 is actually 475 and has no remainder, meaning that it should return True. The code won't work because the if statements need to be nested in a different format. The correct algorithm would be the following, which can also be seen in the picture attached below that if we input 1900 it would output is not a leap year as it fails on the division by 400 which gives a remainder of 0.75
input_year = int(input())
if input_year % 4 == 0:
if input_year % 100 == 0:
if input_year % 400 == 0:
print(input_year, "is a leap year")
else:
print(input_year, "- not a leap year")
else:
print(input_year, "is a leap year")
else:
print(input_year, "- not a leap year")
Answer:
In Python:
Unit_Cost = 200
Cost50 = 50 * Unit_Cost
print("Cost of 50 items: Rs."+str(Cost50))
Explanation:
This initializes the unit cost to 200
Unit_Cost = 200
This calculates the cost of 50 of such items
Cost50 = 50 * Unit_Cost
This prints the calculated cost
print("Cost of 50 items: Rs."+str(Cost50))
Answer:
Most probably option 4, it has nice to earn interest from the bank.
In python the % operator is modulo. Modulo returns the remainder of two numbers.
19 % 5 = 4 therefore,
print(x%y) would output 4