Python Basics Exs Part 1
Python Basics Exs Part 1
Go to the editor ]
5. Write a Python program that accepts the user's first and last
name and prints them in reverse order with a space between
them.
Click me to see the sample solution
6. Write a Python program that accepts a sequence of comma-
separated numbers from the user and generates a list and a tuple
of those numbers.
Sample data : 3, 5, 7, 23
Output :
List : ['3', ' 5', ' 7', ' 23']
Tuple : ('3', ' 5', ' 7', ' 23')
Click me to see the sample solution
12. Write a Python program that prints the calendar for a given
month and year.
Note : Use 'calendar' module.
Click me to see the sample solution
29. Write a Python program that prints out all colors from
color_list_1 that are not present in color_list_2.
Test Data :
color_list_1 = set(["White", "Black", "Red"])
color_list_2 = set(["Red", "Green"])
Expected Output :
{'Black', 'White'}
Click me to see the sample solution
30. Write a Python program that will accept the base and height
of a triangle and compute its area.
Click me to see the sample solution
35. Write a Python program that returns true if the two given
integer values are equal or their sum or difference is 5.
Click me to see the sample solution
37. Write a Python program that displays your name, age, and
address on three different lines.
Click me to see the sample solution
46. Write a Python program to retrieve the path and name of the
file currently being executed.
Click me to see the sample solution
47. Write a Python program to find out the number of CPUs used.
Click me to see the sample solution
56. Write a Python program to get the height and width of the
console window.
Click me to see the sample solution
59. Write a Python program to convert height (in feet and inches)
to centimeters.
Click me to see the sample solution
64. Write a Python program that retrieves the date and time of
file creation and modification.
Click me to see the sample solution
93. Write a Python program to get the Identity, Type, and Value
of an object.
Click me to see the sample solution
94. Write a Python program to convert the bytes in a given string
to a list of integers.
Click me to see the sample solution
111. Write a Python program to make file lists from the current
directory using a wildcard.
Click me to see the sample solution
126. Write a Python program to get the actual module object for
a given object.
Click me to see the sample solution