Python Forum
Unable to count the number of tries in guessing game.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to count the number of tries in guessing game.
#3
Your code reset the random number every tries.
So its impossible to find the number. If you type 5 its to high if you type 4 its too low Wink
The while loop is to calculate the number of tries.

But thank you for this part of the code: check.count = getattr(check, 'count', 0)
count = check.count + 1
check.count += 1

I just tried it and its working fine.
Reply


Messages In This Thread
RE: Unable to count the number of tries in guessing game. - by Frankduc - Mar-20-2022, 07:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Row Count and coloumn count Yegor123 4 1,445 Oct-18-2022, 03:52 AM
Last Post: Yegor123
Question Beginner Boolean question [Guessing game] TKB 4 2,471 Mar-22-2022, 05:34 PM
Last Post: deanhystad
  Problem : Count the number of Duplicates NeedHelpPython 3 4,528 Dec-16-2021, 06:53 AM
Last Post: Gribouillis
  Count number of occurrences of list items in list of tuples t4keheart 1 2,451 Nov-03-2020, 05:37 AM
Last Post: deanhystad
  Guessing game problem IcodeUser8 7 3,817 Jul-19-2020, 07:37 PM
Last Post: IcodeUser8
  Count number of values Kristenl2784 0 1,564 Jul-16-2020, 01:26 PM
Last Post: Kristenl2784
  Beginner Code, how to print something after a number of turns (guessing game) QTPi 4 2,907 Jun-18-2020, 04:59 PM
Last Post: QTPi
  Python Help - Guessing Game JamieT 5 2,872 Apr-16-2020, 01:30 PM
Last Post: deanhystad
  Guessing game kramon19 1 2,251 Mar-25-2020, 04:17 AM
Last Post: deanhystad
  Help for guessing game code Kronos 5 3,388 Mar-09-2020, 04:53 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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