how to make this situation return this result?

Ho Yeung Lee jobmattcon at gmail.com
Sat Jul 1 05:05:34 EDT 2017


sorry for typo,
iiii = 0
jjjj = 0
for ii in range(0,3):
 for jj in range(0,3):
 if iiii < jjjj:
 print (ii, jj) <----- correct here
 jjjj = jjjj + 1
 iiii = iiii + 1
On Saturday, July 1, 2017 at 4:55:59 PM UTC+8, Ho Yeung Lee wrote:
> expect result as this first case
>> ii = 0
> jj = 0
> for ii in range(0,3):
> for jj in range(0,3):
> if ii < jj:
> print (ii, jj)
>>> but below is different
> as sometimes the situation is not range(0,3), but it a a list of tuple 
>> iiii = 0
> jjjj = 0
> for ii in range(0,3):
> for jj in range(0,3):
> if iiii < jjjj:
> print (iiii, jjjj)
> jjjj = jjjj + 1
> iiii = iiii + 1
>> how to make this situation return result like the first case?



More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /