1 2 3 4 5
for i in range(1,6): print(i)
1 3 5
for i in range(1,6,2): print(i)
1 3 5 7 9
for i in range(1,10,2): print(i)
0 1 2 3 4 e n d
for x in range(5): print(x) else: print("e") print("n") print("d")
0 1 0 1 0 1
for x in range(3): for y in range(2): print (y)
0*1* 0*1* 0*1*
for x in range(3): for y in range(2): print (y,end="") print ("*",end="") print()
0 *1 * 0 *1 * 0 *1 *
for x in range(3): for y in range(2): print (y,"*",end="") print()
0 0 1 0 0 1 1 1 0 2 1 2
for x in range(3): for y in range(2): print (y , x)
00 10 01 11 02 12
for x in range(3): for y in range(2): print ('%d%d' % (y,x))
000110112021
for x in range(3): for y in range(2): print ('%d%d' % (x,y),end="")
00.01. 10.11. 20.21.
for x in range(3): for y in range(2): print ('%d%d' % (x,y),end=".") print()
*00*01+ *10*11+ *20*21+
for x in range(3): for y in range(2): print ('*%d%d' % (x,y),end="") print("+")
* ** *** **** *****
for x in range(1,6): for y in range(x): print ("*",end="") print()
***** **** *** ** *
for x in range(5,0,-1): for y in range(x): print ("*",end="") print()
01234 0123 012 01 0
for x in range(5,0,-1): for y in range(x): print (y,end="") print()
01010 0101 010 01 0
for x in range(5,0,-1): for y in range(x): print (y % 2,end="") print()
*1 **2 ***3 ****4 *****5
for x in range(1,6): for y in range(x): print ("*",end="") print(x,end="") print()
*****1 ****2 ***3 **4 *5
for x in range(1,6): for y in range(6 - x): print ("*",end="") print(x,end="") print()
*****1 ****222 ***33333 **4444444 *555555555
for x in range(1,6): for y in range(6 - x): print ("*",end="") for y in range(x * 2 - 1): print(x,end="") print()
1 12 123 1234 12345
for x in range(1,6): for y in range(6 - x): print (" ",end="") for y in range(1,x + 1): print(y,end="") print()
1 121 12321 1234321 123454321
for x in range(1,6): for y in range(6 - x): print (" ",end="") for y in range(1,x + 1): print(y,end="") for y in range(2,x + 1): print(x - y + 1,end="") print()
1 12 123 1234 12345 1234 123 12 1
for x in range(1,6): for y in range(6 - x): print (" ",end="") for y in range(1,x + 1): print(y,end="") print() for x in range(4,0,-1): for y in range(6 - x): print (" ",end="") for y in range(1,x + 1): print(y,end="") print()
1 121 12321 1234321 123454321 1234321 12321 121 1
for x in range(1,6): for y in range(6 - x): print (" ",end="") for y in range(1,x + 1): print(y,end="") for y in range(2,x + 1): print(x - y + 1,end="") print() for x in range(4,0,-1): for y in range(6 - x): print (" ",end="") for y in range(1,x + 1): print(y,end="") for y in range(2,x + 1): print(x - y + 1,end="") print()
123*321 23***32 3*****3
for x in range(1,4): for y in range(x,4): print (y,end="") for y in range(x * 2 - 1): print("*",end="") for y in range(1,5 - x): print(4 - y,end="") print()
123*321 23***32 3*****3 23***32 123*321
for x in range(1,4): for y in range(x,4): print (y,end="") for y in range(x * 2 - 1): print("*",end="") for y in range(1,5 - x): print(4 - y,end="") print() for x in range(2,0,-1): for y in range(x,4): print (y,end="") for y in range(x * 2 - 1): print("*",end="") for y in range(1,5 - x): print(4 - y,end="") print()