Could you find where it went wrong? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Could you find where it went wrong?

Check this my code, and you will know what's wrong : https://code.sololearn.com/cXi2NahnoOkI/?ref=app

28th May 2021, 2:21 AM
hexadecimaL
hexadecimaL - avatar
3 Answers
+ 2
https://code.sololearn.com/cJ8CBl7KP4Gm/?ref=app Hpoe it will help you. read the docstrings below the code to know what was wrong.
28th May 2021, 2:54 AM
Akshay Panwar
Akshay Panwar - avatar
+ 3
you are iteratîng the string hexstr from left to right, but you are supposed to iterate from right to left ^^ to easily fix you code, reverse the hexstr at start of the function ;) anyway, your code could be improved a lot (turn upper the string at start, use ascii code to compute hex digits values rather than iterating over a tuple...), and python provide already conversion function utils ;P
28th May 2021, 2:54 AM
visph
visph - avatar
+ 1
Thank you so much...I'm not really understand about List Slicing.
28th May 2021, 5:41 AM
hexadecimaL
hexadecimaL - avatar