Message from Python discussions
December 2018
— The right version below:
a=raw_input("please give you number.")
b=float(a)
c=int(b)
d=c+int((b-c)*2)
print d
Wrong version below
a=raw_input("please give you number.")
b=float(a)
c=int(a)
d=c+int((b-c)*2)
print d
— Why raw input? use python3 please
— Thank you
— Don't use Python2
— I just do not know why i am wrong.
— 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 examplec = 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