1)Difference between for loop and while loop in Python
For loop is used as to access the element as sequence Ly from our list or Tuple.
In while loop its iterate or give the output when given condition is
true.
2)How is Exceptional handling done in Python?
There is different error while executing the program such as name error, syntax error, index error
To handle this error by using the blocks try-except, try except-else, try except finally.
3)What is the difference between / and // in Python? (2
/ = is use for the purpose of division of the numerical value and if we dividing even number by 2, its
giving out put in decimal ,
// is also use for division, but if we dividing the even number by 2 its giving out as round off, its not
giving out put in decimal point, its known as floor division
For ex.
10 / 3 = 3.33
10//3 = 3 --- its floor division
4) What is a pass in Python?
Whenever we don’t know the what actual code is written , then the pass function is used
(2)
5 )What is a lambda function?
It’s a anonymous function, there is no need to give name of function, its always without name
6) What is List Comprehension? Give an Example.
(2)
7) What are the benefits of using Python language as a tool in the present scenario?
Paython is easy to learn and its very faster rather than other language.
Its object oriented language and its give better satisfaction in machine learning .
(2)
8) Differentiate between List and Tuple?
List is mutable and tuple is immutable
In list , we can insert more memory , tuple having less memory.
We can modify the list but we cannot modify the tupple.
(2)
9) What are Decorators?
(2)
10) What are local and global variables in Python?
The variables inside the block of code is known as local variable.
The variables outside the block of code is known as global variable
(2)
11) write a Python code to find the Minimum of these two numbers (2.5)
a=2
b=5
minimum = min(a,b)
minimum
12) Python program to check whether the string is Symmetrical or Palindrome (2.5)