How many sweets in the jar?

how-many-sweets-in-the-jar“Guess how many sweets are in the jar” is a fundraising game. A large see-through jar is filled with a carefully counted number of sweets. People then try to guess how many sweets are in the jar. Each contestant has to donate a small amount of money to have a go. Guesses are recorded (name + guess). At the end of the game, the nearest guesser wins the content of the jar.

In this challenge we are using a Python script to record the names and guesses (number of sweets) of each contestant. We record this information in a list of lists called guesses.

Your challenge is to complete this code from line 63 to scan through all the guesses from this list and find out who has the nearest guess!



The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 4 / 5. Vote count: 10

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: ,