Adil Khan 6 years ago

Solved - Lab Assignment - Assignment for Sessional Marks

Assignment Questions Question # 01:

Write down function and syntax of following python functions:

  1. input()
  2. eval()
  3. range()
  4. len()
  5. sum()
  6. min()
  7. max()
  8. ()
Question # 02:

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?

  1. from random import randint
Question # 11:

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?

  1. from random import choice
  2. from random import sample
  3. from random import shuffle
Question # 26:

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.

 

Solved - Lab Assignment - Assignment for Sessional Marks _ 1.pdf

Download: Solved - Lab Assignment - Assignment for Sessional Marks _ 1.pdf

Solved - Lab Assignment - Assignment for Sessional Marks _ 0.docx

Download: Solved - Lab Assignment - Assignment for Sessional Marks _ 0.docx

0
1.2K
Development of AI Model Integrating Experimental Analysis for Predicti...

PROJECT SUMMARY: Introduction The exponential development of the electronic industry and c...

1675638330.png
Adil Khan
11 months ago
prereq algo

defaultuser.png
Faseeh Iftikhar
6 years ago
Task Scheduling In Heterogeneous Cloud Computing Environment

Cloud Computing is an on demand provision of processing capability, storage of data, appli...

1675638330.png
Adil Khan
11 months ago
Advance Driving Assistive System

Nearly 1.25 million people die each year in road accidents and road crashes cost low and m...

1675638330.png
Adil Khan
11 months ago
Mobile Phone Detection System in Atomic Defense Area

Human Activity Recognition (HAR) is one of the most effective research areas for computer...

1675638330.png
Adil Khan
11 months ago