vendredi 5 octobre 2018

Creating one for loop for 3 strings

So I have a String called 'Number' with 'abf573'. The task is, to find out if the String 'Number' just has characters and numbers from the Hexadecimal System.

My plan was to make a for loop, where we go through each position of the String 'Numbers', to check with an if statement if it is something out of the Hexadecimal System. To check that, I thought about writing down the A-F, a-f and 0-9 into Lists or separat Strings.

My Problem now is, that I have never done something like this in Python. I know how to make for loops and if-/else-/elif-Statements, but I dunno how to implement this in to this Problem.

Would be nice, if someone can give me a hint, how to do it, or if my way of thinking is even right or not.

Aucun commentaire:

Enregistrer un commentaire