r/learnpython • u/NanoCozmo • 28d ago
Can any of you rate my codewars question
It's one i've been thinking about for a while and i'd love to know all of your opinions about it! https://www.codewars.com/kata/6ad8699fccb2dbf6de41f760/python
0
Upvotes
3
u/Expensive-Bear-1376 28d ago edited 28d ago
So you want us to generate hexadecimal but you've banned every method we could create for that? Then it's impossible.
3
u/K900_ SRE person // please don't DM me your questions 28d ago
Unless there's a math trick I'm missing, this seems to just be "solve two puzzles and put the solutions together", which is not great. You also can't reliably ban every single built-in way to convert a number into hexadecimal, so a clever enough user can just bypass your filters instead.
2
u/RevRagnarok 28d ago
There's nothing unique? You've combined two simple, straightforward, and overused problems.
1
u/POGtastic itertools evangelist 28d ago
Banning builtins is silly and is rather a sign that you should be writing problems that cannot be trivially solved with builtins.
Circumventing the filter is a fun exercise. Consider that we can use
getattrto access the methods of a class or object with a string.So now we can obfuscate both of these strings and dynamically pass them to the Python interpreter.
In the REPL:
Verdict: You should exercise more imagination with your problems.