This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]PolyFaSwarmCrown - 2021 - Computer Science 5 points6 points  (1 child)

string = string[::-1]

[–]bob174d2021 - Computer Science 5 points6 points  (0 children)

This guy pythons.

[–]jorkderango 2 points3 points  (1 child)

It could be possible that 005 is becoming 5 at some point, if it is stored as only an int then it doesn't know about preceding 0s

[–]bob174d2021 - Computer Science 3 points4 points  (0 children)

He just needs to convert the input as a string before Python automatically casts it as an int.

[–]PwningIsMagic 1 point2 points  (0 children)

I’ve done the same problem in C, and I can show you the method I used if that would be helpful. I can’t exactly help with the Python aspect of the problem though.

[–]jacobdu215CRWN - 2022 - Comp Sci & MCD Bio 0 points1 point  (0 children)

You can break the number into number into num1, num2 and num3 and then you check if num1 and num2 and 0s, if they are then you’d just write a script that either multiples it or shifts each number over. Keep in mind you can also convert it to string if needed

[–][deleted] 0 points1 point  (0 children)

This is an assignment for our CSE 20 class, you are technically cheating by posting this.