Python Forum
Ignore character in if statement
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ignore character in if statement
#1
Hello, I am writeing my cipher algorithm and I've problem with my XOR algorithm implementation. How I can ignore character for example comma in IF statement but it's was still been in string. Thanks in advance for help.

for i in range(len(klucz)):
                for x in cipher.find(s,","):
                    if(key_i == x):
                        main_cipher.insert(x,",")
                        #print("Dodaje przecinek na indexie: "+str(x))
                if(key[key_i] != s[key_i]):
                        main_cipher.append("1")
                        #print("Dodaje 1 na indexie => "+str(key_i)+" z porówniania cyfry klucza: "+str(klucz[key_i])+", oraz tekstu: "+str(s[key_i]))
                        key_i += 1
                else:
                        main_cipher.append("0")
                        #print("Dodaje 0 na indexie => "+str(key_i)+" z porówniania cyfry klucza: "+str(klucz[key_i])+", oraz tekstu: "+str(s[key_i]))
                        key_i += 1
Reply


Messages In This Thread
Ignore character in if statement - by Fizo - Sep-08-2018, 03:17 PM
RE: Ignore character in if statement - by Fizo - Sep-08-2018, 04:06 PM
RE: Ignore character in if statement - by Fizo - Sep-08-2018, 05:10 PM
RE: Ignore character in if statement - by Fizo - Sep-09-2018, 12:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Good way to ignore case when searching elements? Winfried 1 871 Apr-25-2024, 12:39 PM
Last Post: menator01
  Ignore WakeWord after it's said Extra 2 1,988 Apr-01-2022, 12:32 AM
Last Post: Extra
  How to ignore "Retrying (Retry(total=2, connect=2, read=5, redirect=5, status=None))" const 3 4,270 Mar-26-2022, 08:55 AM
Last Post: ndc85430
  [solved] unexpected character after line continuation character paul18fr 4 6,744 Jun-22-2021, 03:22 PM
Last Post: deanhystad
  SyntaxError: unexpected character after line continuation character siteshkumar 2 4,163 Jul-13-2020, 07:05 PM
Last Post: snippsat
  Ignore first few letters of a line when reading file. ShakeyPakey 16 11,287 May-30-2020, 02:17 PM
Last Post: BitPythoner
  How to ignore empty columns from DB? Winfried 1 2,974 May-15-2020, 08:35 PM
Last Post: menator01
  How to make the script ignore down devices. wagnergt12 4 4,904 Apr-20-2020, 11:45 PM
Last Post: wagnergt12
  Regex ignore JohnnyCoffee 1 3,500 Mar-16-2020, 12:16 PM
Last Post: scidam
  how can i handle "expected a character " type error , when I input no character vivekagrey 2 3,565 Jan-05-2020, 11:50 AM
Last Post: vivekagrey

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020