You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
858 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

list = ['','','','','','','','','','','','','','','']
list_2 = ['']*15
list_3 = ['' for i in range(15)]
print(list)
print(list_2)
print(list_3)
str = 'XXXXX'
print(str)
for i in range(10):
print(i)
def foo(x,y):
print('两数之和为{}'.format(x+y))
foo(10,11)
board = [[' ']*15 for line in range(15)]
list_4 = ['X','X','O','O']
list_str = ''.join(list_4)
print(list_str)
line = ['O','O','O','O','O']
line_2 = ['O','O','O','O','X']
print('line转化为字符串',''.join(line))
print('line_2转化为字符串',''.join(line_2))
print('查找line是否有5个O',''.join(line).find('O'*5))
print('查找line_2是否有5个O',''.join(line_2).find('O'*5))
def set_chess(x,y,color):
if board[x][y] != ' ':
print('该位置已有棋子')
return False
else:
board[x][y] = color
return True