Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 If statement containing apostrophe
#11
(Jul-09-2019, 09:09 AM)AshBax Wrote:
Output:
['I don’t know'] I don't know WRONG! i want to see : I don’t know
maybe it´s because the two apostrophes are not the same?
’ != '
buran likes this post
Quote
#12
I have been able to create a work around by using the "re" package:
from line 29 onwards:
for i in range(0,len(gameplay_A)):
    answer = input(gameplay_A[i] + "\n")
    new_answer = re.sub("[^a-zA-Z]+", "", answer)
    new_gameplay = re.sub("[^a-zA-Z]+", "", gameplay_B[i])
    if answer.lower() == gameplay_B[i].lower() or new_answer.lower() == new_gameplay.lower():
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Is it possible to have an apostrophe inside { } in an f-string? Exsul 6 654 Sep-05-2019, 12:37 AM
Last Post: Exsul

Forum Jump:


Users browsing this thread: 1 Guest(s)