CodePudding user response:
# a European b d c Asia Oceania Africa e America
For a in range (1, 6) :
A for b in range (1, 6) :
For c in range (1, 6) :
For d in range (1, 6) :
For e in range (1, 6) :
If len ({a, b, c, d, e})==5:
P1=(a==3 and e!=2) or (e==2 and a!
=3)The p2=(c==4 and b! A===2) or (b and c!
=4)P3=(c==1 and d!=5) or (d==5 and c!
=1)P4=(d==4 and b!==3=3) or (b and d!
=4)P5=(a==b and e!=5) or (e==5 and a!
=2)If (p1 + p2 + p3, p4, p5==5:
Print (" Asia: ", c)
Print (" Europe ", a)
Print (" Africa: ", d)
Print (" America, ", e)
Print (" Oceania, ", b)
CodePudding user response:
# puppy kitten a rabbit b c d fawn e
the little monkeyFor a in range (1, 6) :
A for b in range (1, 6) :
For c in range (1, 6) :
For d in range (1, 6) :
For e in range (1, 6) :
If len ({a, b, c, d, e})==5:
P1=dThe p2=a> E
P3=b> A, and b<. D
If (p1 + p2, p3==3:
Print (a, b, c, d, e)
CodePudding user response:
Ls=[' European ', 'America' and 'Asia' and 'Oceania,' African ']
For I in range (5) :
For j in range (5) :
For k in range (5) :
The for m in range (5) :
For n in range (5) :
Temp=(0, ls [I], ls [j], ls [k], ls [m], ls [n])
If len (temp)==len (set (temp)) :
If ((temp [3]=='European') and (temp [2]. (temp)='American') or ([2]=='American') and (temp [3]. )='European') :
If ((temp [4]=='Asia') and (temp [2].='Oceania)) or ((temp [2]==' Oceania ') and (temp [4]. )='Asia') :
If ((temp [1]=='Asia') and (temp [5]. )='African') or ((temp [5]=='African') and (temp [1]. )='Asia') :
If ((temp [4]=='African') and (temp [3].='Oceania)) or ((temp [3]==' Oceania ') and (temp [4]. )='African') :
If ((temp [2]=='European') and (temp [5]. )='American') or ((temp [5]=='American') and (temp [2]. )='European') :
Tu=\ [for]
# for array should not change, so do a new variable tu
For I in range (5) :
Print (f '{tu [I]} is {I + 1} #')
Ls=[' monkey ', 'dog', 'cat' and 'baby', 'rabbit']
For I in range (5) :
For j in range (5) :
For k in range (5) :
The for m in range (5) :
For n in range (5) :
Temp=(0, ls1 [I], ls1 [j], ls1 [k], ls1 [m], ls1 [n])
If len (temp)==len (set (temp)) :
If (temp [3]=='monkey') or (temp [4]=='monkey') and (temp [1].='cat') :
If (temp [2]=='dog') or (temp [3]=='dog') :
If (temp [3]=='rabbit') :
Tu=\ [for]
For I in range (5) :
Print (f '{tu [I]} is the first {I + 1} name')