Input a list of numbers and swap elements at the even location with the elements at the odd location Python Program
Input a list of numbers and swap elements at the even location with the elements at the odd location Python Program # Program to input number list and swapping odd and even index elements # Entering 5 element Lsit mylist = [] print("Enter…
Input a list/tuple of elements and search for a given element in the list/tuple Python Program
Input a list/tuple of elements and search for a given element in the list/tuple Python Program # Python Program to input a list of 5 elements and search element in List mylist = [] print("Enter 5 elements for the list: ") for i in range(5):…
Implement a stack using list Python Program for Class 11
Implement a stack using list Python Program #Python Program to implement stack, Stack operation (PUSH, POP, DISPLAY) stack=[] choice="y" while (choice=="y"): print("1.Push") print("2.Pop") print("3.Show") your_choice=int(input("Enter your…
Input three numbers and display the largest/smallest number Python Program
Input three numbers and display the largest/smallest number Python Program # Python Program to input 3 numbers and display the largest number #input first,Second and third number num1=int(input("Enter First Number")) num2=int(input("Enter Second…
Input two numbers and display the larger/smaller number Python Program
Input two numbers and display the larger/smaller number Python Program # Python Program to input 2 numbers and display larger number #input first number num1=int(input("Enter First Number")) #input Second number num2=int(input("Enter…
Create a dictionary with the roll number, name and marks of n students in a class and display the names of students who have scored marks above 75.
Create a dictionary with the roll number, name and marks of n students in a class and display the names of students who have scored marks above 75. Program no_of_std = int(input("Enter number of students: ")) result = {} for i in range(no_of_std):…
Input a list of numbers and find the smallest and largest number from the list Python Program
Input a list of numbers and find the smallest and largest number from the list Python Program #create empty list mylist = [] number = int(input('How many elements to put in List: ')) for n in range(number): element = int(input('Enter element '))…
Class 11 Informatics Practices Term 2 Sample Paper Set-1
Class 11 Informatics Practices Term 2 Sample Paper Set-1 Subject: Informatics Practices Subject Code: 065 Class 11 Maximum Marks: 35/Time: 2 hours General Instructions The question paper is divided into 3 sections – A, B and C Section A, consists…
Find the smallest/largest number in a list/tuple Python Program
Find the smallest/largest number in a list/tuple # Program to Find the smallest number in a list There may be many approaches to find the smallest number in a list. Here I provide some of the approaches. Approach 1: You can Sort the list…
Class 11 Computer Science Sample Paper Term 2 Set-1
Class 11 Computer Science Sample Paper Term 2 Set-1 Subject Code: 083 Max Marks – 35 /Time – 02 Hrs. General Instructions: ♦ Attempt all questions. The question paper is divided into 3 sections – A, B and C. ♦ Section A, consists of 7 questions (1‐7).…