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
#6
Why are you using random and not binary search?

(Jun-29-2018, 04:00 PM)Zombie_Programming Wrote:
while num2 != num:
....
    else:
        print('Computer guessed correctly')
        break

You can do without the else clause - and print the message after the loop
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
not able to complete a project - by olmin - Jun-29-2018, 04:58 AM
RE: not able to complete a project - by j.crater - Jun-29-2018, 06:52 AM
RE: not able to complete a project - by olmin - Jun-29-2018, 12:13 PM
RE: not able to complete a project - by ichabod801 - Jun-29-2018, 03:00 PM
RE: not able to complete a project - by volcano63 - Jun-29-2018, 07:11 PM
RE: not able to complete a project - by olmin - Jun-30-2018, 09:58 AM
RE: not able to complete a project - by j.crater - Jun-30-2018, 10:09 AM
RE: not able to complete a project - by volcano63 - Jun-30-2018, 10:17 AM
RE: not able to complete a project - by olmin - Jun-30-2018, 02:21 PM
RE: not able to complete a project - by ichabod801 - Jun-30-2018, 02:36 PM

Forum Jump:

User Panel Messages

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