Python Forum
not able to complete a project
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
not able to complete a project
#11
(Jun-30-2018, 10:09 AM)j.crater Wrote: using "binary search"
I've only come across the jargon like if-else, elif and while loop so I created the program with the functions I know.

Python programming for the absolute beginner is a good book, right??

By the way thanks to you all for helping me.
Reply
#12
Binary search is about dividing the search space in half. So you start at the middle (25). Say the response is that you're too low. You now know the answer is in the range 26 to 50. So you go to the middle of that range. Each round you adjust the high and low of the possible range based on the response, and guess the middle of the range.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Forum Jump:

User Panel Messages

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