Reputation:
I'd like a for loop to run whilst 'a' is the larger of 1 and 'b'. How do I make this happen? I guessed that 'for a = max(1,b)' would do it, but I ended up with a problem down the line that I think was caused by this.
Upvotes: 0
Views: 1660
Reputation: 24127
You probably want while a==max(1,b)
. The for
statement you have will run a single time, with a set to the maximum of 1 and b's value at the start of the loop.
Upvotes: 1