#🔒 A school project i need help with

30 messages · Page 1 of 1 (latest)

dull heath
#

Here's my general plan for the project

How many are playing? 1-4
Ask about Handicap
Enter the par of the lane
First ask if you want to play 9 or 18 holes
You can keep your score while driving
show the number of strokes you are on and points
If you only play 9 holes, add par to your own handicap
Calculate final scores

I've gotten stuck on how to make it ask for the score on every hole?

proven spearBOT
#

@dull heath

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

tawdry trail
#

U needa explain what u are trying to do

dull heath
#

Okay so i want the program to ask for a score after every hole, so after you play the first hole you put your score for that hole then it asks for your score all the way to hole 18

tawdry trail
#

What is this hole thing

dull heath
#

Golf

tawdry trail
#

Ok is this a console program

dull heath
#

I have no clue what that means

tawdry trail
#

Is it in the terminal or GUI

dull heath
#

Terminal on vsc

tawdry trail
#

Show ur code so far

dull heath
#
handicap = float(input("Vad har du för handicap \n:"))
bananspar = int(input("Vad har banan för par \n:"))
niohål = int(input("Ska du köra 9 eller 18 hål? \n:"))

holenr = 1
while holenr >= niohål:
        print
queen slate
#

is that how golf works? isn't par individual per course

#

not the same number for all 9 or 18 holes

dull heath
#

Middle one

queen slate
#

I speak swedish, that's why I ask

dull heath
#

Jag fattar inte?

queen slate
#

vad jag vet har varje hål eget par, men du frågar bara en gång om vad par är

dull heath
queen slate
#

ok

dull heath
#

Hur skulle jag kunna få programmet att fråga antal slag efter varje hål?

queen slate
#

stick to english, you're good at it

#

you have something good going with that while loop

dull heath
queen slate
#

!e

hole = 1
while hole < 3:
  print("I could be asking the user questions here, could I not? About hole ", hole)
  hole += 1
proven spearBOT
#

@queen slate :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | I could be asking the user questions here, could I not? About hole  1
002 | I could be asking the user questions here, could I not? About hole  2
dull heath
#

Ah that helps thanks!

proven spearBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.