Python Forum
How to get the position of character
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get the position of character
#6
str1= 'ABCdef'
str2= 'ABCdaf'
u=zip(str1,str2)
print (u)
for i,j in u:
    if i==j:
        print (i,'--',j)
    else: 
        print (i,'  ',j)
I want to get the positions where inequality
Reply


Messages In This Thread
How to get the position of character - by SriRajesh - Sep-16-2019, 12:11 PM
RE: How to get the position of character - by SriRajesh - Sep-16-2019, 01:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 562: ord ctrldan 23 5,151 Apr-24-2023, 03:40 PM
Last Post: ctrldan
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 34: character Melcu54 7 19,542 Sep-26-2022, 10:09 AM
Last Post: Melcu54
  UnicodeEncodeError: 'ascii' codec can't encode character '\xfd' in position 14: ordin Armandito 6 2,848 Apr-29-2022, 12:36 PM
Last Post: Armandito
  [solved] unexpected character after line continuation character paul18fr 4 3,538 Jun-22-2021, 03:22 PM
Last Post: deanhystad
  python error: bad character range \|-t at position 12 faustineaiden 0 3,741 May-28-2021, 09:38 AM
Last Post: faustineaiden
  SyntaxError: unexpected character after line continuation character siteshkumar 2 3,239 Jul-13-2020, 07:05 PM
Last Post: snippsat
  how can i handle "expected a character " type error , when I input no character vivekagrey 2 2,798 Jan-05-2020, 11:50 AM
Last Post: vivekagrey
  Replace changing string including uppercase character with lowercase character silfer 11 6,340 Mar-25-2019, 12:54 PM
Last Post: silfer
  UnicodeEncodeError: 'charmap' codec can't encode character '\u2019' in position 23: c kapilan15 2 4,476 Jan-14-2019, 09:11 PM
Last Post: Gribouillis
  python charmap codec can't decode byte X in position Y character maps to < undefined> owais 9 39,333 Apr-28-2018, 10:52 PM
Last Post: abadawi

Forum Jump:

User Panel Messages

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