New course! Every coder should learn Generative AI!
Try a free lesson+ 10
Lol! Is there in Python like 'while i>0 && d>0' or while i,d>0? Or only one variable?
Help!
6 Answers
+ 2
@B. Gognoscere
Python converts that kind of expression directly into a boolean.
And you cannot compare more than two values with >
A possibility would be
while ( [i,n].all() != 0):
If not you have to use 'and' operator
+ 8
Booleans? None this: while (i, d>0): ?
+ 7
I need to create decision to find a function value: z=1/xy as long as x,y!=0
+ 6
I tried, the same error:
IndentationError: expected an indented block
+ 4
> is used for binary comparison.
Thus, it can only compare 2 objects.
+ 3
You can give the while method as many variables and expression you want, as long as they are booleans. You should put it between parenthesis though.