##1, Program analysis
Chess is 8*8 Of ,i(07) Representative bank ,j(07) Representative column . When i+j When it's odd , It's a black check , conversely , White check .

##2, Program implementation

<> Method 1 : Double cycle

(1) program :
for i in range(8): for j in range(8): if (i+j)%2!=0: print(chr(219)*2,end='')
else: print(' ',end='') print('')
(2) Effect display :

<> Method 2 : Circular printing of elements

(1) program
# Realize the circular movement of string def MoveLeft(string,n): n1=abs(n) length=len(string) n1= n1%length
# Number of cyclic shifts if n==0: # Do not move return string elif n<0: # Move left
string_n=string[n1:]+string[0:n1] else: # Move right
string_n=string[(length-n1):]+string[0:(length-n1)] return string_n #a='123456'
#b=MoveLeft(a,1) #print(b) def main(): a=' 11 11 11 11' i=0 while i<8: print(a)
a=MoveLeft(a,-2) i+=1 main()
(2) Experimental effect

(3) Program analysis
Method 2 uses the method of string cyclic movement , Compared with method one, it is more convenient

©2019-2020 Toolsou All rights reserved,
Final review of database : Summary of comprehensive application questions use Python Make simple games Laplance operator ( Second derivative ) Convert hard disk to GPT Partition format Python Implementation of Hanoi Tower code about String How to create objects vue3 Learning journey 1—— establish vue3 project java String from back to front _Java String String summary use Python Write a story about plants versus zombies 【 Greedy Algorithm 】 Huffman coding problem