Message from Python discussions

December 2018

— Sorry.i am a beginner with only py2 book at hand.

— 

What's wrong? looks like it works... have you checked the line 3? in first example you did:
c = int(b)
in second example
c = int(a)
maybe is that the «error»?

— You can get loads of material online to learn from

— Yes.i think so too.but why?where is the logic error here,i am confuses.

— You should try checking line 3
I think it should be int (b)

— If you're a beginner, you can use a paper and a pen to follow what the code does and you will see what's happening

Message permanent page

— XD

— Int(b) version totally operatable.

— c = int(a) too

— Int(a)version feedback error.i dont just understand why.

— What error?

— /data/user/0/org.qpython.qpy/files/bin/qpython-android5.sh "/storage/emulated/0/qpython/integer.py" && exit
torage/emulated/0/qpython/integer.py" && exit <
please give you number.5.5
Traceback (most recent call last):
File "/storage/emulated/0/qpython/integer.py", line 3, in <module>
c=int(a)
ValueError: invalid literal for int() with base 10: '5.5'
1|hwedison:/ $

Message permanent page