Message from Python discussions
December 2018
— I just have copied almost everything from here
Hi everyone.i am a beginning learner of python.i just write 2 versions of very simple codes for the same stupid purpose. one is operatable.the other is not.i cannot figure out why.anybody here can help me?
— A lot of people will be willing to help you
But they would need to look at the code...
— It looks like it's the official documentation:
https://www.statsmodels.org/stable/iolib.html#module-statsmodels.iolib
maybe it can help you
— 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»?