Python Programming Exercises, Schemes and Mind Maps of Computer science

A series of practical programming exercises in python, covering various topics such as linear and binary search, random number generation, string functions, file handling, data structures like queue and stack, and integration with sql databases. The exercises are designed to help students develop their programming skills and understanding of fundamental programming concepts. Detailed descriptions of the aims, software used, input, and output for each practical exercise. By working through these exercises, students can gain hands-on experience in applying python programming techniques to solve real-world problems and enhance their problem-solving abilities.

Typology: Schemes and Mind Maps

2021/2022

Uploaded on 11/20/2022

archanaa-u
archanaa-u 🇮🇳

7 documents

1 / 40

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
PRACTICAL FILE
COMPUTER SCIENCE
SESSION -2021-22
NAME - ……………………….
CLASS - ……………………....
ROLL No. - …………..……..
SCHOOL - ………………………..
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download Python Programming Exercises and more Schemes and Mind Maps Computer science in PDF only on Docsity!

PRACTICAL FILE

COMPUTER SCIENCE

SESSION - 2021 - 22

NAME - ……………………….

CLASS - ……………………....

ROLL No. - …………..……..…

SCHOOL - ………………………..

COMPUTER SCIENCE RECOMMENED PRACTICAL LIST

FOR CLASS XII

TERM 1

  1. Write a python program to search an element in a list and display the frequency of element present in list and their location using Linear search by using user defined function. [List and search element should be entered by user]
  2. Write a python program to search an element in a list and display the frequency of element present in list and their location using binary search by using user defined function. [List and search element should be entered by user]
  3. Write a python program to pass list to a function and double the odd values and half even values of a list and display list element after changing.
  4. Write a Python program input n numbers in tuple and pass it to function to count how many even and odd numbers are entered.
  5. Write a Python program to function with key and value, and update value at that key in dictionary entered by user.
  6. Write a Python program to pass a string to a function and count how many vowels present in the string.
  7. Write a Python program to generator(Random Number) that generates random numbers between 1 and 6 (simulates a dice) using user defined function.
  8. Write a python program to implement python mathematical functions.
  9. Write a python program to implement python string functions.
  10. Write a python program to read and display file content line by line with each word separated by #.
  11. Write a python program to remove all the lines that contain the character ‘a’ in a file and write it to another file.
  12. Write a python program to read characters from keyboard one by one, all lower case letters gets stored inside a file “LOWER”, all uppercase letters gets stored inside a file “UPPER”, and all other characters get stored inside “OTHERS”

PRACTICAL- 1 AIM - Write a program to search an element in a list and display the frequency of element present in list and their location using Linear search SOFTWARE USED - IDLE (PYTHON 3.8 64 - bit) INPUT OUTPUT

PRACTICAL- 2 AIM- Write a to search an element in a list and display the frequency of element present in list and their location using Binary Search SOFTWARE USED- IDLE (PYTHON 3.8 64 - bit) INPUT OUTPUT

PRACTICAL- 4 AIM - Write a program to input n numbers in tuple and pass it to function to count how many even and odd numbers are entered SOFTWARE USED - IDLE (PYTHON 3.8 64 - bit) INPUT OUTPUT

PRACTICAL- 5 AIM - Write a program to function with key and value, and update value at that key in dictionary entered by user SOFTWARE USED - IDLE (PYTHON 3.8 64 - BIT) INPUT OUTPUT

PRACTICAL- 6 AIM - Write a program to pass a string to a function and count how many vowels present in the string SOFTWARE USED - IDLE (PYTHON 3.8 64 - BIT) INPUT OUTPUT

PRACTICAL- 7 AIM - Write a program to generator that generates random numbers between 1 and 6 using user defined function SOFTWARE USED - IDLE (PYTHON 3.8 64 - BIT) INPUT OUTPUT(S)

print("**** QUEUE DEMONSTRATION ******") print("1. ENQUEUE ") print("2. DEQUEUE") print("3. PEEK") print("4. SHOW QUEUE ") print("0. EXIT") ch = int(input("Enter your choice :")) if ch==1: val = int(input("Enter Item to Insert :")) Enqueue(Q,val) elif ch==2: val = Dequeue(Q) if val=="Underflow": print("Queue is Empty") else: print("\nDeleted Item was :",val) elif ch==3: val = Peek(Q) if val=="Underflow": print("Queue Empty") else: print("Front Item :",val) elif ch==4: Show(Q) elif ch==0: print("Bye") break **OUTPUT **** QUEUE DEMONSTRATION ********

  1. ENQUEUE
  2. DEQUEUE
  3. PEEK
  4. SHOW QUEUE
  5. EXIT Enter your choice :1 Enter Item to Insert : **** QUEUE DEMONSTRATION ******
  6. ENQUEUE
  7. DEQUEUE
  8. PEEK
  9. SHOW QUEUE
  10. EXIT Enter your choice :

Enter Item to Insert : **** QUEUE DEMONSTRATION ******

  1. ENQUEUE
  2. DEQUEUE
  3. PEEK
  4. SHOW QUEUE
  5. EXIT Enter your choice : Enter Item to Insert : **** QUEUE DEMONSTRATION ******
  6. ENQUEUE
  7. DEQUEUE
  8. PEEK
  9. SHOW QUEUE
  10. EXIT Enter your choice : (Front) 10 ==> 20 ==> 30 ==> **** QUEUE DEMONSTRATION ******
  11. ENQUEUE
  12. DEQUEUE
  13. PEEK
  14. SHOW QUEUE
  15. EXIT Enter your choice : Front Item : 10 **** QUEUE DEMONSTRATION ******
  16. ENQUEUE
  17. DEQUEUE
  18. PEEK
  19. SHOW QUEUE
  20. EXIT Enter your choice : Deleted Item was : 10 **** QUEUE DEMONSTRATION ******
  21. ENQUEUE
  22. DEQUEUE
  23. PEEK
  24. SHOW QUEUE
  25. EXIT Enter your choice :4 (Front) 20 ==> 30 ==> **** QUEUE DEMONSTRATION ******

PRACTICAL- 9 AIM - Write a program to implement python string functions SOFTWARE USED - IDLE (PYTHON 3.8 64 - BIT) INPUT OUTPUT

PRACTICAL- 10 AIM - Write a program to read and display file content line by line with each word separated by #. SOFTWARE USED - IDLE (PYTHON 3.8 64 - BIT) INPUT OUTPUT