
Patrick B. answered 02/02/21
Math and computer tutor/teacher
currentNumber =13
if (int(currentNumber) % 2)==1:
currentNumber = int(currentNumber)*3+1
else:
currentNumber = (int(currentNumber))/2
print(str(currentNumber))
year=2021
leapYear=bool(False)
if (int(year)%4)==0:
if (int(year)%100)==0:
if (int(year)%400)==0:
leapYear = bool(True)
else:
leapYear = bool(False)
else:
leapYear=bool(True)
if (leapYear==True):
print(str(year) + " is a leap year")
else:
print(str(year) + " is not a leap year")
distance=987
cost = 0.00
if (int(distance)>=0) and (int(distance)<=100):
cost=5.00
elif (int(distance)>100) and (int(distance)<=500):
cost=8.00
elif (int(distance)>500) and (int(distance)<1000):
cost=10.00
elif (int(distance)>=1000):
cost=12.00
print('Distance ' + str(distance) + ' costs ' + str(cost))