Python Interview Question| Interview Problem

 Python Interview Problem



  • In python interview many people find difficult to give answer of that question .In interview don't feel worry and feel relax to say answer ,In python the question are related to basics of python i.e class11 more like string ,list,tuple and dictionary and their functions.

So to prepare yourself here we will solve some questions 

So Lets start,


Q. 1)What is python? 

Ans. Python is a simple and easy language it is easy to understand. It is an object-oriented language, which makes coding easy to make a program. 


Q. 2)Who has invented python language? 

Ans.It was integrated in 1991 by Guido Van Rossum, he got this by seeing one show i.e comedy series whose name was Monty Python's flying circus telecasted on BBC. 


Q. 3)Which type of language used by python? 

Python use interpreter language, which check the error line by line, if an error in first lene then it will first ask to rectify then it will move to another line. 




Q. 4)Which function is used to find maximum from the list? 

Ans. max() function is used to determine maximum from the list. 

Q. 5)Name the function is used to find minimum value from the list? 

Ans. min() function is used to determine the minimum from the list. 


Q. 6) What is Tuple and  how to convert Tuple to string? 

Ans. A tuple is a sequential datatype and to store values () parenthesis is used. 

To convert Tuple to string 

Example:

Tuple=(1, 2) 

print(str(Tuple)) 

Q. 7) Name the immutable datatype? 

Ans. String Tuple and the keys of the dictionary are immutable. 

Q. 8) Which function is used to add more than one element at the end of the list? 

Ans. extend() function

Q. 9) Name the function is used to add only single element in the list? 

Ans. append() is used to add single element in the list? 

Q. 10)Is string can concatenate? 

Ans. Yes, string can concatenate only with another string. 

Q.11) Can we change the key in the dictionary? why? 

Ans. No, we cannot change the keys in the dictionary because it is immutable. 

Q. 12)Who was the founder of the python language? 

Ans. Guido Van Rossum

Q. 13)Is any disadvantages of the python language? Give points. 

Ans. Yes, it's some disadvantages, 

1) it's library is very small

2) it is a very slow language

Q.14) Name the function which is used to delete any element from the dictionary? 

Ans. del[ ] function is used to delete any key-value pair. Inside the square box just have to write key name. 

Q. 15)Which function used to delete the element using index number in the list? 

Ans. remove() is used to delete the element using index number. 

Q. 16)How to make empty list after deleting all the elements? 

Ans. To delete all the elements and left empty list for the in built function i.e clear() function. 

Programming questions Logic

Q. Write a Program  to check given number is even or odd?

Answer:

n=12

it is even

n=101

it is odd


Q.WAP to Check a given year is Leap year or not?

Answer:

Testcases1:

2001

Output:

Not leap year

Testcases2:

1996

Output:

Leap Year

Q. Write a program to swap to numbers without using third variable.

Answer:

Testcases1:

a=10

b=90

Output:

a=90

b=10

Testcases2:

a=4

b=5

Output:

a=5

b=4


No comments:

Powered by Blogger.