Python Forum
Missing positional arguments error??
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Missing positional arguments error??
#1
def lattice_moves(n, m, l):
    if n==0 and m==0 and l==0:
        return 1
    elif n==0 and m==0:
        return (lattice_moves(n, m, (l-1)))
    elif n==0 and l==0:
        return (lattice_moves(n, (m-1), 1))
    elif m==0 and l==0:
        return (lattice_moves((n-1), m, l))
    elif n==0:
        return (lattice_moves((n, m-1, l)))+(lattice_moves(n, m, (l-1)))
    elif m==0:
        return (lattice_moves(((n-1), m, l)))+(lattice_moves(n, m, (l-1)))
    elif l==0:
        return (lattice_moves(((n-1), m, l)))+(lattice_moves(n, (m-1), l))
    else:
        return (lattice_moves(((n-1), m, l)))+(lattice_moves(n, (m-1), l))+(lattice_moves(n, m, (l-1)))
print(lattice_moves(2, 2, 2))
I keep getting the error "
Error:
File "C:\Users\gc2190\untitled0.py", line 34, in lattice_moves return (lattice_moves(((n-1), m, l)))+(lattice_moves(n, (m-1), l))+(lattice_moves(n, m, (l-1))) TypeError: lattice_moves() missing 2 required positional arguments: 'm' and 'l'", can anyone see a way to fix it?
Reply


Messages In This Thread
Missing positional arguments error?? - by hhydration - Oct-01-2020, 12:47 AM
RE: Missing positional arguments error?? - by buran - Oct-01-2020, 05:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: __init__() missing 1 required positional argument: 'successor siki 1 4,333 Mar-08-2021, 02:05 PM
Last Post: Larz60+
  Missing 1 required positional argument in python code edwinostby 7 10,027 Jan-19-2021, 12:52 PM
Last Post: Serafim
  TypeError: Missing required positional arguments liaisa 7 29,170 Sep-25-2020, 08:16 PM
Last Post: deanhystad
  missing positional argument error programmert 1 2,837 Oct-18-2019, 11:05 AM
Last Post: Larz60+
  missing 1 required positional argument jedmond2 4 6,751 Sep-19-2019, 12:00 PM
Last Post: jefsummers
  missing 1 required positional argument mcgrim 10 19,865 May-07-2019, 09:02 PM
Last Post: Yoriz
  TypeError: __init__() missing 3 required positional arguments Pythonhelp82 6 23,200 Jan-24-2019, 04:25 AM
Last Post: Pythonhelp82
  TypeError: method missing 1 positional argument koolinka 4 5,083 Nov-18-2018, 04:53 PM
Last Post: ichabod801
  another positional argument error (...and executing objects stored in a list) itmustbebunnies 7 4,235 Nov-16-2018, 07:18 PM
Last Post: itmustbebunnies
  Class positional argument error itmustbebunnies 2 3,027 Nov-07-2018, 11:09 AM
Last Post: stullis

Forum Jump:

User Panel Messages

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