##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

Technology
©2019-2020 Toolsou All rights reserved,
The 11th Blue Bridge Cup python The real topic of the University Group National Games JavaSwing To achieve a simple Lianliankan games 【Spring Source code analysis 】42-@Conditional Detailed explanation element-ui Step on pit record 2019PHP Interview questions ( Continuously updated )PHPJava Misunderstanding —— Method overloading is a manifestation of polymorphism ? First issue 500 100 million , Set up a new Department , What is Tencent going to do ? Google chrome The browser can't open the web page , But what if other browsers can open it ? Regression of dependent variable order categories (R language )【Golang Basic series 10 】Go language On conditional sentences if