Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Volleyball game
#4
In the for loop you are checking for conditions (team scoring at least 25 points, win by at least 2...). But if the condition is not met, program only prints out the warning message and goes on to next iteration (next match). Instead it should require the user to enter scores again, until they are proper.

Regarding design of program itself, I would recommend you to put checking for the conditions regarding scores in a new function. And call that function from within match function. Also, code readibility and maintainability would benefit greatly from following the famous PEP 8 style guide. In your case particularly 2 blank lines between function definitions. PEP 8 is a recommended read. Oh and in your else statement, scorevisitor > scorehome seems to have no use.
Reply


Messages In This Thread
Volleyball game - by DrewD - Dec-11-2017, 05:34 AM
RE: Volleyball game - by j.crater - Dec-11-2017, 06:51 AM
RE: Volleyball game - by DrewD - Dec-11-2017, 07:25 PM
RE: Volleyball game - by j.crater - Dec-11-2017, 07:44 PM
RE: Volleyball game - by DrewD - Dec-12-2017, 02:52 AM
RE: Volleyball game - by j.crater - Dec-13-2017, 06:21 AM
RE: Volleyball game - by DrewD - Dec-13-2017, 05:09 PM
RE: Volleyball game - by j.crater - Dec-13-2017, 06:49 PM
RE: Volleyball game - by DrewD - Dec-14-2017, 07:23 PM
RE: Volleyball game - by DrewD - Dec-15-2017, 03:06 AM
RE: Volleyball game - by j.crater - Dec-16-2017, 09:41 AM
RE: Volleyball game - by DrewD - Dec-17-2017, 04:15 AM
RE: Volleyball game - by Terafy - Dec-17-2017, 04:48 AM
RE: Volleyball game - by Terafy - Dec-17-2017, 05:39 AM
RE: Volleyball game - by DrewD - Dec-17-2017, 07:28 PM
RE: Volleyball game - by Terafy - Dec-17-2017, 07:59 PM
RE: Volleyball game - by DrewD - Dec-17-2017, 08:22 PM
RE: Volleyball game - by Terafy - Dec-17-2017, 08:28 PM

Forum Jump:

User Panel Messages

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