Question: Python Code: 1. Write a new function, typed_sorted_lists() that takes two lists as arguments. Return the unique items in both lists as separate lists, one

Python Code:

1. Write a new function, typed_sorted_lists() that takes two lists as arguments. Return the unique items in both lists as separate lists, one only containing a descending-sorted list of ints (high to low), and the other only containing a descending-sorted list of strings (z to a).

For example,

>>> l1 = [1, 10, 2, 3, 3, 4, 4, 4, 5, 6, 7, 8, 'spam', 'dinsdale', 3.14, 'zara', 'apple'] >>> l2 = [1, 3, 32, 5, 7, 9, 11, 13, 'dinsdale', 'spam', 'fred', 'apple'] >>> type_sorted_lists(l1, l2)

2.

Given a list of lists of characters such as:

grid = [['.', '.', '.', '.', '.', '.'], ['.', '0', '0', '.', '.', '.'], ['0', '0', '0', '0', '.', '.'], ['0', '0', '0', '0', '0', '.'], ['.', '0', '0', '0', '0', '0'], ['0', '0', '0', '0', '0', '.'], ['0', '0', '0', '0', '.', '.'], ['.', '0', '0', '.', '.', '.'], ['.', '.', '.', '.', '.', '.']]

Write a program that prints the grid so that it looks like this:

..00.00.. .0000000. .0000000. ..00000.. ...000... ....0....

where grid[0][0] is at the top left and grid[len(grid)-1][0] is at the top right, grid[0][len(grid[0])-1] is at the bottom left and grid[len(grid)-1][len(grid[0])-1] is on the bottom right.

(You're basically turning the image on its side and reversing it.

Make sure it will work with any similar grid.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!