ARTICLEViews: 34Share  Posted by - Anonymous

python questions and assignments

1. Write a Python program to check a list is empty or not


my_list = [] # empty list


if len(my_list) == 0:

print("List is empty")

else:

print("List is not empty")


2. Write a Python program to remove duplicates from a list.


3. Write a Python function that takes two lists and returns True if they have at least one common member


4. Write a Python program to get the difference between the two lists


5. Write a Python program to find the second smallest number in a list


6. Write a Python program to find the second largest number in a list.


7. Write a Python program to get the frequency of the elements in a list


Python Assignment 2A Answers | CCBP Python Assignment 2A Solutions | CCBP Newly Added Python Questions Answers #ccbp ...

Python Assignment 1B Answers | CCBP Python Assignment 1B Solutions | Newly Added Python Questions

Python Assignment 1A Answers | CCBP Python Assignment 1A Solutions | Newly Added Python Questions

Python Exercises for Beginners - Exercise #1

Assignment Questions on Dictionaries with Solutions - Python



Views -