Re: [Tutor] Fahrenheit to Celsius Conversion with if else statements

2017-06-12 Thread William Gan
Alan Gauld [mailto:alan.ga...@yahoo.co.uk] Sent: Tuesday, June 13, 2017 1:36 AM To: tutor@python.org Subject: Re: [Tutor] Fahrenheit to Celsius Conversion with if else statements On 12/06/17 15:17, William Gan wrote: > print('Enter C for Celsius to Fahrenheit or F for Fahrenheit to > Ce

Re: [Tutor] Fahrenheit to Celsius Conversion with if else statements

2017-06-12 Thread Alan Gauld via Tutor
On 12/06/17 15:17, William Gan wrote: > print('Enter C for Celsius to Fahrenheit or F for Fahrenheit to Celsius.') > unit = input('Enter C or F:') > temp = int(input('Enter temperature:')) > > if unit == 'C': Note this only t5ests for 'C' - ie capital C. You might want to force the input to be u

[Tutor] Fahrenheit to Celsius Conversion with if else statements

2017-06-12 Thread William Gan
Good day Everybody, I am practicing coding when I encountered a problem with the if and else statements in my code. Hope someone can help me understand my mistake. The following is my code to convert Fahrenheit to Celsius and vice-versa: print('Enter C for Celsius to Fahrenheit or F for Fahrenh