Python Forum
If statement containing apostrophe
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If statement containing apostrophe
#8
You don't show code that we cant test and what's gameplay_A[i], gameplay_B[i]?
You probably should not loop like this gameplay_A[i].

Just to make something similar that run.
>>> gameplay_A = ['Question:_1', 'Question:_2']
... lst = []
... for i,item in enumerate(gameplay_A):
...     answer = input(gameplay_A[i] + "\n")
...     lst.append(answer)
Question:_1
i don't know
Question:_2
hello world

>>> lst
["i don't know", "hello world"]
If gameplay_B[i] list contains the same it's True.
>>> gameplay_B = ["i don't know", "hello world"]

>>> lst == gameplay_B
True
Reply


Messages In This Thread
If statement containing apostrophe - by AshBax - Jul-08-2019, 10:57 AM
RE: If statement containing apostrophe - by AshBax - Jul-08-2019, 11:18 AM
RE: If statement containing apostrophe - by buran - Jul-08-2019, 11:31 AM
RE: If statement containing apostrophe - by AshBax - Jul-08-2019, 12:29 PM
RE: If statement containing apostrophe - by snippsat - Jul-08-2019, 01:47 PM
RE: If statement containing apostrophe - by AshBax - Jul-09-2019, 09:09 AM
RE: If statement containing apostrophe - by ThomasL - Jul-09-2019, 11:25 AM
RE: If statement containing apostrophe - by buran - Jul-09-2019, 10:08 AM
RE: If statement containing apostrophe - by AshBax - Jul-09-2019, 01:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  CSV not printing apostrophe correctly bazcurtis 8 4,518 Aug-22-2022, 04:28 PM
Last Post: bazcurtis
  Is it possible to have an apostrophe inside { } in an f-string? Exsul 6 12,552 Sep-05-2019, 12:37 AM
Last Post: Exsul

Forum Jump:

User Panel Messages

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