Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bars = 0
- days = 0
- bar_in_day = 0
- bar_in_month = 0
- bar_in_year = 0
- import math
- for month in range(1,13):
- if month == 1 or month ==3 or month == 5 or month == 7 or month == 8 or month == 10 or month ==12:
- days = 31
- elif month == 4 or month == 6 or month == 9 or month == 11:
- days = 30
- elif month == 2:
- days = 29
- for day in range(1,days+1):
- bar_in_day = day%10 + day%10 + month%10 + month/10+2+0+1+6
- if (math.sqrt(bar_in_day) - int(math.sqrt(bar_in_day))) == 0 or ((bar_in_day)**(1./3) - int((bar_in_day)**(1./3))) == 0:
- bar_in_day = 0
- bar_in_month = bar_in_month + bar_in_day
- print "Bars sold in month "+str(month)+": "+str(bar_in_month)
- bar_in_year = bar_in_year + bar_in_month
- print "Bars sold in year 2016: "+str(bar_in_year- (2+4+1+2+2+0+1+6))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement