Solved - Lab Assignment - Assignment for Sessional Marks
2020-01-02 20:40:37 - Adil Khan
Write down function and syntax of following python functions:
- input()
- eval()
- range()
- len()
- sum()
- min()
- max()
- ()
Write down the syntax of if-else, elif and if-then-else in python
Question # 03:Write down the syntax of for loop. What is the role of indentation in a loop?
Question # 04:What are the variable naming rules in python?
Question # 05:What are the math operators for exponentiation, integer division and remainder?
Question # 06:What is order of math operations?
Question # 07:What is a random number? How it is generated in python?
Question # 08:What are the functions in math module of python?
Question # 09:How many built-in math functions are used in python?
Question # 10:What does the following command do?
- from random import randint
List down the conditional and logical operators in python.
Question # 12:What is difference between “=” and “==” operators?
Question # 13:x=5 and y=10, write code to swap values of x and y.
Question # 14:What is the purpose of flag variable in python?
Question # 15:What are the techniques of adding comments to a python code?
Question # 16:What are the techniques of creating strings in python?
Question # 17:What is difference between concatenation and reputation?
Question # 18:What is the use of “in” operator?
Question # 19:What does the negative indexing mean in a string variable? Explain with the help of an example.
Question # 20:What is a “slice” in case of a string variable. Explain with the help of n example.
Question # 21:What is the purpose of lower(), upper(), replace(x,y), count(x) and isalpha() methods?
Question # 22:List down “escape characters” with brief definition of each one.
Question # 23:What is difference between a list and a dictionary?
Question # 24:What is the purpose of insert() and pop() functions in a list?
Question # 25:What does the following command do?
- from random import choice
- from random import sample
- from random import shuffle
What do the split() and join() functions do with a list?
Question # 27:What is a two-dimensional list? What are the applications of a two-dimensional list?
Question # 28:Write down the general syntax of a while loop
Question # 29:What is the purpose of break statement?
Question # 30:What are the Boolean variables in a python? What are the applications of Boolean variables.
Download: Solved - Lab Assignment - Assignment for Sessional Marks _ 1.pdf
Download: Solved - Lab Assignment - Assignment for Sessional Marks _ 0.docx