This document contains 20 multiple choice and code-based questions about Python programming concepts like data types, operators, loops, lists, tuples, functions, comments, and decision-making statements. The questions cover topics such as bitwise operators, membership operators, list/tuple functions and examples, loop syntax, single and multi-line comments, local and global variables, updating and slicing lists, if/elif/else statements, and appending to lists and tuples.
This document contains 20 multiple choice and code-based questions about Python programming concepts like data types, operators, loops, lists, tuples, functions, comments, and decision-making statements. The questions cover topics such as bitwise operators, membership operators, list/tuple functions and examples, loop syntax, single and multi-line comments, local and global variables, updating and slicing lists, if/elif/else statements, and appending to lists and tuples.
This document contains 20 multiple choice and code-based questions about Python programming concepts like data types, operators, loops, lists, tuples, functions, comments, and decision-making statements. The questions cover topics such as bitwise operators, membership operators, list/tuple functions and examples, loop syntax, single and multi-line comments, local and global variables, updating and slicing lists, if/elif/else statements, and appending to lists and tuples.
2) Name the operator which a) Appends the second list or first tuple to the first. b) Returns True if the object exists in the given list or tuple. 3) Write the syntax FOR loop in Python. 4) Name different modes of python. 5) List identity operators in python. 6) Give two differences between list and tuple. 7) Explain Local and Global variables. 8) How to give single and multi line comments in python. 9) Explain Pass & Break in loop 10) WAP in python to update a list using extend() function. 11) Explain the built in function of the list with one example of each. 12) Explain the built in function of tuple with one example of each 13) List data types in python. Explain mutable and immutable data type. 14) WAP in python to print the factorial of the user entered number using a while loop. 15) Explain the following w.r.t. Tuple each with one example. a) Creating a tuple b) Updating tuple element 16) Write a program to print following: 1 12 123 1234 17) Explain membership and assignment operators with example 18) Explain indexing and slicing in a list with examples. 19) Explain decision making statements If- else, if- elif- else with example. 20) a) Write the output of the following: i) >>> a = [2, 5, 1, 3, 6, 9, 7 ] >>> a [ 2 : 6] = [ 2, 4, 9, 0] >>> print (a) ii) >>> b = [ “Hello” , “Good” ] >>> b. append ( “python” ) >>> print (b)