31-40 Python Questions

 31.Write a function that takes a list of numbers and returns a new list with the unique elements from the original list. 

32.Write a function to find the greatest common divisor (GCD) of two numbers.  

33.Write a Python program to find the occurrences of an element in a tuple. 

 

34. Write a Python script to insert a new key with a specific value in an existing dictionary.

35.Cite an example to explain the process to include an element in a given list.

36.Write a Python script to check if a dictionary is empty or not.

37.Write a Python script to convert a list into a nested dictionary of keys. 

38.Write a Python program to convert a list to a set. 

39.Write a Python program to create a new list by concatenating multiple lists. 

40.Write a Python program to remove an item from a tuple

Post a Comment

Post a Comment (0)