Calculations and Variables

Rhodri James rhodri at kynesim.co.uk
Fri Nov 1 08:36:16 EDT 2019


On 31/10/2019 20:14, MRAB wrote:
> On 2019-10-31 18:46, ferzan saglam wrote:
>> The code below which I have written should print the result of 43.6 
>> with the given values I have included at the end of this question, but 
>> for some odd reason I get the result of 44.44.
>>
>>
>> bill = (input("Enter the total cost of the meal: \n"))
>> tip = (input("Enter how much the tip is: \n"))
>> split = (input("Enter how many people there are: \n"))
> 
> Why are there parentheses around the inputs? Have you omitted the 
> conversion to numbers?

My guess is the OP is using Python2 rather than Python3.  So my first 
piece of advice would be to switch to Python3 now so you don't have to 
re-learn oddities like input(), print() and string handling.

-- 
Rhodri James *-* Kynesim Ltd


More information about the Python-list mailing list