Python Forum
Guessing Game with .WAV Files - Python Coding
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Guessing Game with .WAV Files - Python Coding
#8
Quote:
random.choice(tuple(sounds.keys()))
(Or list instead of tuple.) To be more proper, rather than doing it in the loop though, I'd "cache" the keys and pull them out of the loop as a tuple.

I did list instead of tuple. Both ways however seem to... Play the windows sound. The sound of when you have a box open and have to deal with that before you click on anything else. Strange really.
Reply


Messages In This Thread
RE: Guessing Game with .WAV Files - Python Coding - by NonEntity - Nov-18-2018, 11:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Beginner Boolean question [Guessing game] TKB 4 2,568 Mar-22-2022, 05:34 PM
Last Post: deanhystad
  Unable to count the number of tries in guessing game. Frankduc 7 2,155 Mar-20-2022, 08:16 PM
Last Post: menator01
  Tic-Tac game (Beginner's coding) Shahmadhur13 5 3,375 Aug-29-2020, 08:40 PM
Last Post: deanhystad
  Guessing game problem IcodeUser8 7 3,943 Jul-19-2020, 07:37 PM
Last Post: IcodeUser8
  Beginner Code, how to print something after a number of turns (guessing game) QTPi 4 2,982 Jun-18-2020, 04:59 PM
Last Post: QTPi
  Python Help - Guessing Game JamieT 5 2,955 Apr-16-2020, 01:30 PM
Last Post: deanhystad
  Guessing game kramon19 1 2,294 Mar-25-2020, 04:17 AM
Last Post: deanhystad
  Help for guessing game code Kronos 5 3,495 Mar-09-2020, 04:53 PM
Last Post: snippsat
  guessing the number game go127a 6 5,057 Apr-27-2019, 01:23 PM
Last Post: go127a
  Guessing Game does not work the_entrepreneur 3 2,960 Apr-20-2019, 06:19 AM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

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