Python Forum
TypeError: add() missing 2 required positional arguments
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: add() missing 2 required positional arguments
#1
Hello,I am new to parameters and I am having difficulties understanding my code does not work.




# Tables

Table_A = 0
Table_B = 0
Table_C = 0

# Seats remaining

seat_A = 4
seat_B = 6
seat_C = 2

def add(user_In,Table,Seat):
    for i in range(user_In):
        Table += 1
        Seat -= 1
    return(Table)

def sit():
    global Table_A, Table_B, Table_C, seat_A, seat_B, seat_C
    while True:
        time.sleep(1)
        # Showing Tabls
        print("\nShowing Tables\n")
        time.sleep(1)
        # Table A
        print("Table - A has -", (Table_A), "- people / -", (seat_A), "- seats remaining")
        # Table B
        print("Table - B has -", (Table_B), "- people / -", (seat_B), "- seats remaining")
        # Table C
        print("Table - C has -", (Table_C), "- people / -", (seat_C), "- seats remaining\n")
        time.sleep(1)
        # User Input
        user_In = input ("Which table would you like to choose: ")
        user_In = user_In.upper()
        if user_In == "A":
            Table = Table_A
            Seat = seat_A
            time.sleep(1)
            user_In = int(input("How many people are sitting? Max -" + str(Seat) + ": "))
            # Table A Returned
            print("\nTable - A has - " , add(user_In), "- in it") 
Reply


Messages In This Thread
TypeError: add() missing 2 required positional arguments - by NectDz - May-28-2020, 12:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: a bytes-like object is required ZeroX 13 4,076 Jan-07-2023, 07:02 PM
Last Post: deanhystad
  Error TypeError: output_type_handler() takes 2 positional arguments but 6 were given paulo79 1 1,934 Oct-17-2022, 06:29 PM
Last Post: paulo79
  TypeError: a bytes-like object is required, not 'str' - Help Please. IanJ 3 4,791 Aug-29-2022, 05:53 PM
Last Post: deanhystad
  TypeError: not enough arguments for format string MaartenRo 6 2,919 Jan-09-2022, 06:46 PM
Last Post: ibreeden
  TypeError: missing a required argument: 'y' gible 0 2,902 Dec-15-2021, 02:21 AM
Last Post: gible
  TypeError: missing 3 required positional arguments: wardancer84 9 10,845 Aug-19-2021, 04:27 PM
Last Post: deanhystad
  TypeError: run_oracle_job() missing 1 required positional argument: 'connection_strin python_student 1 1,962 Aug-06-2021, 08:05 PM
Last Post: SheeppOSU
  python 3: TypeError: a bytes-like object is required, not 'str' wardancer84 3 6,475 Jul-09-2021, 05:55 PM
Last Post: deanhystad
  TypeError: max_value() missing 2 required positional arguments: 'alpha' and 'beta' Anldra12 2 4,202 May-15-2021, 04:15 PM
Last Post: Anldra12
  TypeError: sum() missing 1 required positional argument: 'num2' Insen 3 5,453 Jan-06-2021, 04:25 PM
Last Post: Insen

Forum Jump:

User Panel Messages

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