On 12/04/17 13:47, Wim Berrelkamp wrote: >>>> a=2
Here you assign the number 2 to 'a' >>>> d=a+4 >>>> print(d) > 6 > a=input('-->' ) Here you assign whatever character(s) the user types to 'a'. The fact that it looks like 2 doesn't change the fact that it is really the character '2'. So you need to convert it to a number using either int() or float() a = int(input('-->')) or a = float(input('-->')) > print(a) > d=a+4 > print(d) > > I tried to use float(), but nothing works. > What am I doing wrong ? I don't know, because you don't show us how you tried to use float(), but if you apply it as shown above it should work. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor