Day 7
Set :
Set is an in-built data type in python. It is an unordered collection of data.
It is iterable
It is mutable
It has no duplicates
Let's solve a few problems on set :
- Find the maximum and minimum in a Set :
s=([67,34,27,45,1])
print(set(s))
print(max(set(s)))
print(min(set(s)))
output :
- To convert a set into a list
s={1,6,3,4}
print(list(s))
output:
Problems on Set :
Write a python program to check if two lists have at least one element common
Write a python program to find common elements in three lists using sets
Write a python program to find missing and additional values in two lists
Write a python program to find the difference between two lists
Write a python program to find a lost element from a duplicated array
Write a python program to count the number of vowels using sets in a given string
Write a python program to concatenated string with uncommon characters in Python
Write a python program to accept the strings which contain all vowels
Write a python program to check if a given string is a binary string or not
Write a python program to check if the string is an anagram
Write a python program for pairs of complete strings in two sets
In my next blog,you will get to know about dictionary data types.
Thank You !