Re: Help a noob out

2019-05-02 Thread DL Neil
On 2/05/19 9:30 PM, Arup Rakshit wrote: The input function returns the string value. So you need to convert it to number before the math you do. birth_year = input("What year are you born? ") current_year = 2019 print(type(birth_year)) age = current_year - int(birth_year) print(age) — py

Re: Help a noob out

2019-05-02 Thread Hampus Sjödin
Den torsdag 2 maj 2019 kl. 11:43:53 UTC+2 skrev inhahe: > On Thu, May 2, 2019 at 5:26 AM wrote: > > > Hey guys, can someone quickly explain why this piece of code doesn't work? > > (I'm really new to Python) > > > > birth_year = input("What year are you born? ") > > current_year = 2019 > > age =

Re: Help a noob out

2019-05-02 Thread inhahe
On Thu, May 2, 2019 at 5:26 AM wrote: > Hey guys, can someone quickly explain why this piece of code doesn't work? > (I'm really new to Python) > > birth_year = input("What year are you born? ") > current_year = 2019 > age = current_year - birth_year > print(age) > -- > https://mail.python.org/ma

Re: Help a noob out

2019-05-02 Thread Arup Rakshit
The input function returns the string value. So you need to convert it to number before the math you do. birth_year = input("What year are you born? ") current_year = 2019 print(type(birth_year)) age = current_year - int(birth_year) print(age) — python3 age.py What year are you born? 1989

Re: Help a noob out

2019-05-02 Thread Chris Angelico
On Thu, May 2, 2019 at 7:26 PM wrote: > > Hey guys, can someone quickly explain why this piece of code doesn't work? > (I'm really new to Python) > > birth_year = input("What year are you born? ") > current_year = 2019 > age = current_year - birth_year > print(age) Have you looked at the excepti

Help a noob out

2019-05-02 Thread felixen989
Hey guys, can someone quickly explain why this piece of code doesn't work? (I'm really new to Python) birth_year = input("What year are you born? ") current_year = 2019 age = current_year - birth_year print(age) -- https://mail.python.org/mailman/listinfo/python-list