Python Forum
Rock, Paper, Scissors.. Help..hidden bug
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rock, Paper, Scissors.. Help..hidden bug
#3
Line 48 is your error. A few ways to fix, look at this code:
print(str)
print(str == 'string')
print(type('string'))
print(str == type('string'))
Output:
<class 'str'> False <class 'str'> True
I think you are trying to see if y is a string. You can check the type, or you could try isinstance() to see if y is in the str class
Reply


Messages In This Thread
RE: Rock, Paper, Scissors.. Help..hidden bug - by jefsummers - Mar-18-2020, 06:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Rock Paper Scissors Project in Python ankitdixit 8 5,095 Feb-23-2024, 03:14 PM
Last Post: DPaul
  Copy only hidden files and folders with rsync Cannondale 2 1,173 Mar-04-2023, 02:48 PM
Last Post: Cannondale
  Trying to create a visual rock paper scissors game urmom33 1 1,133 Dec-03-2022, 09:12 PM
Last Post: deanhystad
  Can ZipFile be used to extract hidden files? AiedailEclipsed 0 1,737 Mar-22-2022, 05:21 PM
Last Post: AiedailEclipsed
  Rock paper scissors in python with "algorithm" Agat0 23 6,466 Mar-01-2022, 03:20 PM
Last Post: Agat0
  Problem restricting user input in my rock paper scissors game ashergreen 6 4,827 Mar-25-2021, 03:54 AM
Last Post: deanhystad
  Odd behavior with Rock Paper Scissor game DustinKlent 2 2,039 Aug-27-2020, 03:55 PM
Last Post: DustinKlent
  Run hidden exe samuelbachorik 0 2,800 Aug-02-2020, 03:10 PM
Last Post: samuelbachorik
  Trying to implement Best of 3 logic in rock paper scissors game ShAhCh 5 3,552 May-11-2020, 04:31 PM
Last Post: ShAhCh
  Rock Paper Scissors with dictionaries ewgreht 2 4,012 May-01-2020, 03:19 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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