VIVA BASED Questions PROJECT VIVA a. Be thorough in your project. b. Logic used (in terms of storing data / reading text files / manipulation of data) c. For application based projects • Adding Records • Modification • Deletion • Search on fields Binary file operations. d. Working of Project In the first category i.e. “about project title” the few questions are: a) What is the significance of this title? b) Why you choose this title? c) Are you think that this title is suitable for Class XII ? d) Can you give any other title to your project work? e) Can you explain your title of the project in 100 words? h) What does your project do? i) How much time you taken in Analysis, Coding and Testing j) What are the uses of the project? Q Explain database connection in Python Q Mention the use of the split function in Python? Ans The use of the split function in Python is that it breaks a string into shorter strings using the defined separator. It gives a list of all words present in the string. Q Mention five benefits of using Python? · Python comprises of a huge standard library for most Internet platforms like Email, HTML, etc. · Python does not require explicit memory management as the interpreter itself allocates the memory to new variables and free them automatically · Provide easy readability due to use of square brackets · Easy-to-learn for beginners · Having the built-in data types saves programming time and effort from declaring variables Q Mention the use of // operator in Python? Ans It is a Floor Division operator , which is used for dividing two operands with the result as quotient showing only digits before the decimal point. For instance, 10//5 = 2 and 10.0//5.0 = 2.0. Q Explain how can you access a module written in Python Q Explain how can you generate random numbers in Python? Ans: by importing random module and To generate random numbers in Python, you need to import command as import random random.random() random.randint() random.randrange() Q Explain how to delete a file in Python? Ans By using a command os.remove (filename) Q Mention what are the rules for local and global variables in Python? Ans Local variables: If a variable is assigned a new value anywhere within the function's body, it's assumed to be local. Global variables: Those variables that are only referenced inside a function are implicitly global. Q What is module and package in Python? Ans In Python, module is the way to structure program. Each Python program file is a module, which imports other modules like objects and attributes. The folder of Python program is a package of modules. A package can have modules or subfolders. Q How you can convert a number to a string? Ans: In order to convert a number into a string, use the inbuilt function str(). If you want a octal or hexadecimal representation, use the inbuilt function oct() or hex(). Q What is negative index in Python? Ans Python sequences can be index in positive and negative numbers. For positive index, 0 is the first index, 1 is the second index and so forth. For negative index, (-1) is the last index and (-2) is the second last index and so forth. Q What is docstring in Python? Ans Python documentation string is known as docstring, it is a way of documenting Python functions, modules. Q In Python what is slicing? Ans A mechanism to select a range of items from sequence types like list, tuple, strings etc. is known as slicing. Q In Python what are iterators? Ans In Python, iterators are used to iterate a group of elements, containers like list. Q What is pass in Python? Ans Pass means, no-operation Python statement, or in other words it is a place holder in compound statement, where there should be a blank left and nothing has to be written there. Pass is a jump statement . other jump statement are break and continue( revise concept) Q What are the built-in type does python provides? Ans There are mutable and Immutable types of Pythons built in types Mutable built-in types List Sets Dictionaries Immutable built-in types Strings Tuples Numbers Q What is Dict and List comprehensions are? Ans They are syntax constructions to ease the creation of a Dictionary or List based on existing iterable. Q How are arguments passed by value or by reference? Ans Everything in Python is an object and all variables hold references to the objects. The references values are according to the functions; as a result you cannot change the value of the references. However, you can change the objects if it is mutable. Q What is the difference between list and tuple? Ans The difference between list and tuple is that list is mutable while tuple is not. Tuple can be hashed for e.g as a key for dictionaries. Q How Python is interpreted? Ans Python language is an interpreted language. Python program runs directly from the source code. It converts the source code that is written by the programmer into an intermediate language, which is again translated into machine language that has to be executed. Q How memory is managed in Python? Ans Python memory is managed by Python private heap space. All Python objects and data structures are located in a private heap. The programmer does not have an access to this private heap and interpreter takes care of this Python private heap. The allocation of Python heap space for Python objects is done by Python memory manager. The core API gives access to some tools for the programmer to code. Python also have an inbuilt garbage collector, which recycle all the unused memory and frees the memory and makes it available to the heap space. Q What is Python? What are the benefits of using Python? Ans Python is a programming language with objects, modules, threads, exceptions and automatic memory management. The benefits of pythons are that it is simple and easy, portable, extensible, build-in data structure and it is an open source.