def monthly_gas_cost(days,miles,mpg,gas_cost):
return '${} A month for gas'.format(miles/mpg*days*gas_cost)
Я делал простую функцию в python и только что использовал python, не думая, она работала с
print(monthly_gas_cost(days=23,miles=4,mpg=30,gas_cost=2.87))
но когда я пробую строку ниже, он выполняет вычисления только с python 3. С python 2 он не вычисляется.
print(monthly_gas_cost(days=23,miles=12,mpg=20,gas_cost=2.87))