Informatics Practices Project File:: Name: Shambhavi Shekhar Singh Class: 11 A' Science
Informatics Practices Project File:: Name: Shambhavi Shekhar Singh Class: 11 A' Science
lst = []
num = int(input('How many numbers: '))
for n in range(num):
numbers = int(input('Enter number '))
lst.append(numbers)
print("Maximum element in the list is :", max(lst), "\nMinimum element in the list is :", min(lst))
Output-
How many numbers : 6
Enter number 25
Enter number 96
Enter number 32
Enter number 54
Enter number 74
Enter number 29
Maximum element in the list is : 96
Minumim element in the list is : 25
13. Program 13- Write a python program to find out the third largest number in a list.
Source code-
num = [2,3,7,4,5,6,10,11,120]
for i in num :
if i > largest_num :
third_largest_num = second_largest_num
Output-
Source code-
15. Program 15- Create a dictionary to store the names of states and their capitals.
Source code-
states = dict()
n = int(input("How many states are there : ")) for i in range(n): state=input("Enter name of the state: ")
print("Created dictionary is :"states) temp = input("Enter the state to display capital : ")
Created dictionary is: {'Gujrat': 'Ahmedabad', 'Bihar': 'Patna'} Enter the state to display capital: Gujrat
Ahmedabad
The End.