Question: in python, # 6. Write some code that creates a 12 x 12 array in a checkerboard pattern of x's # and o's. # 7.
in python,
# 6. Write some code that creates a 12 x 12 array in a checkerboard pattern of x's # and o's.
# 7. Write some code that examines three variables that reference integers x,y, and z, # and prints the smallest value.
# 8. Write some code that examines three variables that reference integers x,y, and z, # and prints the middle value.
# 9. Assume x is a two-dimensional list and r and c represent a row number and column # number. Write a function called validPositions which is passed x, r, and c, and # returns a list of 2-tuples of valid adjacent positions on the board. For example, # if x is has 5 rows and 5 columns and r = 0, c = 0, the function returns # [(1,0),(1,1),(0,1)]
#10. Write a function called zip which is passed two equal lenght strings and returns # a string with the letters interleaved. For example, if zip is passed "aaa" and "bbb", # the function returns "ababab"
#11. Write a function called flip which is passed an even-length string and which # returns a string with each character in an even position interchanged with the # next adjacent character in the odd position. For example, if the string "abcdefgi" # was passed to flip, the function would return "badcfeig"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
