+ 1

Another problem

same program as the last question, but I don't understand why it is outputing the numbers it is https://code.sololearn.com/cQ81mRpKlBfy/?ref=app

19th May 2018, 1:04 AM
Brayden Parker
Brayden Parker - avatar
9 ответов
+ 4
num //= 10 will do integer divide
19th May 2018, 1:14 AM
John Wells
John Wells - avatar
+ 4
It takes time and practice to be good at everything in life. Python is no difference.
19th May 2018, 1:19 AM
John Wells
John Wells - avatar
+ 1
num /= 10 This line will make Python automatically convert num from an integer to a floating point number. Try replacing the line with this to convert it back into an integer (cutting off all digits behind the comma): num = int(num/10) Is this the result you want?
19th May 2018, 1:10 AM
Chris
Chris - avatar
+ 1
ok, thanks
19th May 2018, 1:15 AM
Brayden Parker
Brayden Parker - avatar
+ 1
yeah it did, I have since written a few codes that used that actually!
19th May 2018, 11:27 AM
Brayden Parker
Brayden Parker - avatar
+ 1
they are still WIP though
19th May 2018, 11:29 AM
Brayden Parker
Brayden Parker - avatar
0
I am so bad at python...
19th May 2018, 1:18 AM
Brayden Parker
Brayden Parker - avatar
0
Oh, integer division. I haven't used Python in a while, sorry :) But I hope that my explanation helped a bit.
19th May 2018, 11:26 AM
Chris
Chris - avatar
0
Please i am a completely novice in all area, how can i get started?
7th Mar 2022, 9:33 PM
Enwereji Praise
Enwereji Praise - avatar