Python – Valid character list

Hi, let us check the given string against a valid character list. There might be numerous way to do this. Here is a sample one.   str_to_check = “1234-3*33?3+—-!” valid_chars = “0123456789-+” uyan_char_sayisi = 0 uymayan_listesi = “” uymayan_char_sayisi = 0 str_to_check_uzunluk = len(str_to_check) valid_chars_uzunluk = len(valid_chars) #print(str_to_check_uzunluk) for i in range(0,str_to_check_uzunluk): for j in…
Read more