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 5 elements for the list: “) for i in range(5): … Read more

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): value = int(input()) mylist.append(value) print(“Enter an element to … Read more

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 choice”)) if (your_choice==1): num=input(“Input any number”) stack.append(num) elif(your_choice==2): if (stack==[]): print(“Stack is empty”) else: print(“The deleted element is:”,stack.pop()) elif (your_choice==3): l=len(stack) for i in range(l-1,-1,-1): print(stack[i]) else: print(“Wrong … Read more

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 Number”)) num3=int(input(“Enter Third Number”)) #Check if first number is greater than rest of the two numbers. if (num1> num2 and num1> num3): … Read more

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 Second Number”)) #Check if first number is greater than second if (num1>num2): print(“The Larger number is”, num1) else: print (“The Larger number … Read more

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): print(“Enter Details of student No.”, i+1) roll_no = int(input(“Roll No: “)) … Read more

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 ‘)) mylist.append(element) print(“Maximum element in the list is :”, max(mylist)) print(“Minimum element in … Read more

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 of 7 questions (1-7). Each question carries 2 marks. Section B, consists of 3 … Read more

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). Each question carries 2 marks. ♦ Section B, … Read more

Copywrite © 2020-2025, CBSE Python,
All Rights Reserved