List of Programs-27.09.22
List of Programs-27.09.22
8. Write a Python program to sort a given mixed list of integers and strings. Numbers must be
sorted before strings.
Original list:
[19, 'red', 12, 'green', 'blue', 10, 'white', 'green', 1]
Sort the said mixed list of integers and strings:
[1, 10, 12, 19, 'blue', 'green', 'green', 'red', 'white']
9. Write a program which accepts a sequence of comma-separated numbers from console and
generate a list and a tuple which contains every number.
Suppose the following input is supplied to the program:
34,67,55,33,12,98
Then, the output should be:
['34', '67', '55', '33', '12', '98']
('34', '67', '55', '33', '12', '98')
10. Write a program, which will find all such numbers between 1000 and 3000 (both
included) such that each digit of the number is an even number.
The numbers obtained should be printed in a comma-separated sequence on a single line.
11. Define a function which can print a dictionary where the keys are numbers between 1 and
3 (both included) and the values are square of keys.