Skip to main content

GRADE XII CS - VIVA QUESTIONS

 

VIVA QUESTIONS

GRADE XII CS

Dear All

Be thorough with your project and practical files, as the viva can be asked from anywhere. Stay calm, don’t get nervous, and be confident in front of the examiner.

1. Tell me about your project.

2. Which concepts you have used for your project?

3. What do you mean by front end and back end? How they are important in developing any such projects?

4  Mention the modules and built-in functions you have used in your project.

5. Which real world problems are solved by your project?

6. Explain the most important feature of your project.

7. Name a few mutable data types of python.

Lists, Sets, and Dictionaries

8. Name a few immutable data types of python.

Strings, Tuples, Numeric

9. Name ordered and unordered data type of python.

Ordered – String, List, Tuples

Unordred – Set, Dictionaries

10. What is the significance of a pass statement in python?

pass is no operation python statement. This is used where python requires syntax but logic requires no actions.

11. What is slicing in python?

Python slicing is a statement of python that extracts a list of elements from the given sequence in the range of start and stop values with step value intervals.

12. How to check the variables stored in same object in python?

The id() function returns the memory address of python object.

13. How to remove the last element from a list?

To remove the last element from a list following ways can be used:

l.pop()

del l[-1]

14. What is the difference between append() and extend() methods?

append() is used to add an element to the list to the last.

extend() is used to add multiple elements to the list.

15. What are the needs of function in the python program?

16. What are parameters and arguments in python programs?

17. What is the local and global scope variable?

18. What are mutable and immutable arguments/parametersin a function call?

Mutable arguments/parameters values changed over the access of value and variable at runtime.

Immutable arguments/parameters whose values cannot be changed. They allocate new memory whenever the value is changed.

19. What are the different modes of opening a file?

The different modes of opening a file are as follows:

r,w,a,r+,w+,a+,rb,wb,ab,rb+,wb+,ab+

20. What is the difference between readline() and readlines() function?

readline() function reads the content of the text file and returns the content into the string whereas readlines() function reads the content of the text file and returns the content into the list.

21.Are CSV files and Text Files same?

CSV files and Text Files are same in storage but csv file stores the data separated by a delimiter.

22. What is Pickling & unpickling?

23. Name the functions used to read and write data into binary files.

pickle.dump(list_object, file_handle)

pickle.load(file_object)

24. What is the significance of tell() and seek() functions?

tell() function returns the current file position in a file

seek() function change the current file position

25. What are the operations can be performed on the stack?

Push

Pop

Peep or Peek

26. Exception handling in Python.

27. Difference between Having and where clause in MySQL / Update & Alter.

28. What is the purpose of DISTINCT clause.

29. What are wild card characters in MySQL.

30. Difference between group by and order by.
31. Revise EQUI / Natural and cross Join.

                                                     PRACTICAL QUESTIONS

1. Write a Python program to create a binary file named product.dat and perform the following operations using user-defined functions.

Each record in product.dat contains the following fields:

Product ID, Product Name, Category, Price, Stock Quantity
These records should be stored as a list object. 

Implement the following functions:
AddProductDetails() – To create and store product details in the file.
DisplayProductRecords() – To display all records and count the total number of records in the file.

2. Write a Python program to create a binary file named inventory.dat and perform the following operations using user-defined functions.

Each record in inventory.dat contains the following fields:

Product Code, Product Name, Unit Price, Stock Quantity
These records should be stored as a list object. Implement the following functions:

CreateInventory() – To create and store product details in the file.
CalculateTotalValue() – Computes the total stock value by multiplying the unit price and quantity of each product.

3.Write a Python program to implement a stack using a list. Define the following functions:

peven(stack, data) – This function takes an empty list stack and a list of numbers data. It should push only the even numbers from data onto the stack.
popst(stack) – This function removes and returns the top element of the stack on each call.
Also, write function calls to demonstrate the working of the stack.

4. Write a Python program to implement a stack using a list. Define the following functions:

peven(stack, data) – This function takes an empty list stack and a list of numbers data. It should push only the ODD numbers from data onto the stack.
popst(stack) – This function removes and returns the top element of the stack on each call.
Also, write function calls to demonstrate the working of the stack.

5. Revise CSV / Text file and Stack questions from HY and PreBoard papers.


All the best !
Kirti Hora






Comments

Popular posts from this blog

PYTHON - MYSQL CONNECTIVITY CODE

  #INSERTION OF DATA import mysql.connector mydb = mysql.connector.connect( host="localhost", user="root", passwd="root", database="school" ) print("Successfully Connected") #print(mydb) mycursor=mydb.cursor()   v1=int(input("enter ID:")) v2=input("enter name:") v3=input("enter Gender:") v4=int(input("enter age:")) sql='insert into TEACH values("%d","%s","%s","%s")'%(v1,v2,v3,v4) print(sql) mycursor.execute(sql) mydb.commit() print("record added") #MYSQL Connection code – Deletion on database SOURCE CODE: s=int(input("enter id of TEACHER to be deleted:")) r=(s,) v="delete from TEACH where id=%s" mycursor.execute(v,r) mydb.commit() print("record deleted") MYSQL Connection code – Updation on database SOURCE CODE: import mysql.connector mydb = mysql.connector.c...

REVISION IF CONSTRUCT | CLASS TEST

                                                                                     CLASS TEST 1. Write a Python program that asks the user for their age, gender, and current fitness level (beginner, intermediate, or advanced). Based on this information, suggest a suitable fitness plan using if-else statements. Requirements: Inputs : Age (integer) Gender (male/female) Fitness level (beginner/intermediate/advanced) Outputs : Recommend a fitness plan that includes: Suggested workout duration. Type of exercises (e.g., cardio, strength, flexibility). Rest days. Logic : Use if-else to determine the plan based on conditions such as: Age group (e.g., <18, 18–40, >40). Fitness leve...