Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while True:
- cap = input()
- if cap == "":
- break
- capList = cap.split() #The method split() returns a list of all the words in the string, using str as the separator
- mistake = 0
- i = 0
- accepted = ["c","k","s","v","y","e","o","t","w","z","f","p","u","x","I","l"]
- while i<len(capList[0]):
- if capList[0][i] != capList[1][i]:
- mistake += 1
- if capList[1][i].lower() in accepted:
- if capList[0][i].lower() == capList[1][i].lower():
- mistake-=1
- if capList[1][i] == "l" and capList[0][i] == "I" or capList[1][i] == "I" and capList[0][i] == "l":
- mistake-=1
- i+=1
- if mistake:
- if len(capList[1]) > 5 and mistake < 2:
- print("Right " + str(mistake))
- if len(capList[1]) > 5 and mistake >= 2:
- print("WRONG " + str(mistake))
- if len(capList[1]) <= 5:
- print("WRONG " + str(mistake))
- if not mistake:
- print("Right " + str(mistake))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement