jan = "january" feb = "february" mar = "march" apr = "april" may = "may" jun = "june" jul = "july" aug = "august" sep = "september" oct = "october" nov = "november" dec = "december" calender_year = [ jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec ] winter_season = [ dec, jan ] summer_season = [ jun, jul, aug ] vacation_months = [ mar, aug ] distance_through_city_kladusa_one_way = 330 distance_through_city_kladusa_two_way = distance_through_city_kladusa_one_way * 2 distance_through_city_kostajnica_one_way = 321 distance_through_city_kostajnica_two_way = distance_through_city_kostajnica_one_way * 2 overall_distance = 0 for m in calender_year: # we go home usually twice during one month, # but for vacation months I stay at home in Bosnia if m in vacation_months: # not traveling, staying in Bosnia continue elif m in winter_season or m in summer_season: # during the winter and summer seasons to avoid traffic congestion # we pass through city of Kostajnica to minimize our waiting time at the border overall_distance += 2 * distance_through_city_kostajnica_two_way else: # otherwise, we pass through city of Kladusa overall_distance += 2 * distance_through_city_kladusa_two_way print "Overall distance travelled during one year " + str(overall_distance) + "km" averrage_fuel_consumption = 7.5 total_fuel_consumption = ( overall_distance / 100 ) * 7.5 print "Overall fuel consumption: " + str(total_fuel_consumption) + "l" + " Diesel "