Write Program Using List Lists Characters Prints Following Grid X O X O O X O X X O O X O Q37083411

Write a program that using a list of lists of characters, printsthe following grid:

  • x o x o
  • o x o x
  • x o o x
  • o x x o

An inner list could look like this: [‘x’,’o’,’x’,’o’].

The inner list has to look like that ^.

Input Format

none

Constraints

none

Output Format

a grid


Solution


#This is a python codelst = []for i in range(4): temp = [] for j in range(4): if((i+j)%2==0): temp.append(‘x’) else:

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.