Python Forum
The problem of the cuts
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The problem of the cuts
#9
As micseydel said. "1:" is not valid python code. Are you trying to do some sort of select or case statement? Those do not exist in Python. You have to use if/elif/else:

if i == 1:
    cuts(x, y, L-vx[i], h)
elif i == 2:
    # cuts call for 2
elif i == 3:
    # cuts call for 3
elif i == 4:
    # cuts call for 4
However, you're going to run into other problems. Your function has no return statement. All it will ever return is None. You probably want to return the results of the recursive calls, and something from the final else statement, but that's not entirely clear to me.

More descriptive variable names would be good, too.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
The problem of the cuts - by ics - Jan-19-2017, 07:35 PM
RE: The problem of the cuts - by micseydel - Jan-19-2017, 08:21 PM
RE: The problem of the cuts - by ics - Jan-19-2017, 08:37 PM
RE: The problem of the cuts - by micseydel - Jan-19-2017, 08:39 PM
RE: The problem of the cuts - by wavic - Jan-19-2017, 08:48 PM
RE: The problem of the cuts - by ics - Jan-19-2017, 08:48 PM
RE: The problem of the cuts - by micseydel - Jan-19-2017, 08:53 PM
RE: The problem of the cuts - by ics - Jan-19-2017, 09:01 PM
RE: The problem of the cuts - by ichabod801 - Jan-19-2017, 10:39 PM

Forum Jump:

User Panel Messages

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