0

I'm having trouble with a for loop that is going to ask for an assignment score and a max score that could have been achieved. But I'm getting the following error message [input expected at most 1 argument, got 3]

I kind of understand what that means but, how do I go about getting the results of the following screenshot below? I'm just focused on getting the error message resolved. Also in getting for loop to execute properly.

enter image description here

Here is the code that I have so far

#defing funtion for homeowrk
def homeWork():

    #Asking user for weight of assignment
    weight = int(input("Weight (0-100)? "))

    #Ask user for number of assignments will determine how many times the question will run
    numberOfAssignment = int(input("Number of assignments? "))

    #if statment that will execute dependant on user input
    for i in range(numberOfAssignment):

        #prompt user for assignment score
        assignmentScore = int(input("Assignment", i + 1 ,"max?"))

        # prompt user for assignment optiential score
        maxScore = int(input("Assignment", i + 1 ,"max? "))

#calling funtion
homeWork()

1
  • Read tour and How to Ask. You should replace your picture of text with the actual text. And please edit into your question the full text of the error message, as text, so it’s possible to see which line gives the error message, and the call stack that got there. Commented Oct 1, 2021 at 21:18

1 Answer 1

1

Input is not like print: you have to do the string munging yourself. Instead of

input("this", "that", 8)

You want

input(f"this that {8}")
Sign up to request clarification or add additional context in comments.

2 Comments

WOW that worked, I'm not seeing that in the book I'm reading but I'll take it!
This is actually the norm: taking n arguments and joining them together is only done in a few built in functions, for convenience

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.