/Python_Programming_Interview_Questions

These Python Programming Language Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of Python Programming Language. As per my experience good interviewers hardly plan to ask any particular question during your interview, normally questions start with some basic concept of the subject .

**Problems Related to Lists in Python ** .

Dear Students, these Python Programming Language Interview Questions have been designed specially for u to get you acquainted with the nature of questions you may encounter during your interview for the subject of Python Programming Language.

  • Note:- The Following Questions Covers the concepts which are discussed in class. You all students have to submit it as a assignment for ur practice.

  • What is Python?

  • Name some of the features of Python.

  • What is the purpose of PYTHONPATH environment variable?

  • Is python a case sensitive language?

  • What are the supported data types in Python?

  • What is the output of print str if str = 'Hello World!'?

  • What is the output of print str[0] if str = 'Hello World!'?

  • What is the output of print str[2:5] if str = 'Hello World!'?

  • What is the output of print str[2:] if str = 'Hello World!'?

  • What is the output of print str * 2 if str = 'Hello World!'?

  • What is the output of print str + "TEST" if str = 'Hello World!'?

  • What is the output of print list if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?

  • What is the output of print list[0] if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?

  • What is the output of print list[1:3] if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?

  • What is the output of print list[2:] if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?

  • What is the output of print tinylist * 2 if tinylist = [123, 'john']?

  • What is the output of print list + tinylist * 2 if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ] and tinylist = [123, 'john']?

  • What are tuples in Python?

  • What is the difference between tuples and lists in Python?

  • What is the output of print tuple if tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 )?

  • What is the output of print tuple[0] if tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 )?

  • What is the output of print tuple[1:3] if tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 )?

  • What is the output of print tuple[2:] if tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 )?

  • What is the output of print tinytuple * 2 if tinytuple = (123, 'john')?

  • What is the output of print tuple + tinytuple if tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 ) and tinytuple = (123, 'john')?

  • What are Python's dictionaries?

  • How will you create a dictionary in python?

  • How will you get all the keys from the dictionary?

  • How will you get all the values from the dictionary?

  • How will you convert a string to an int in python?

  • How will you convert a string to a long in python?

  • How will you convert a string to a float in python?

  • How will you convert a object to a string in python?

  • How will you convert a String to an object in python?

  • How will you convert a string to a list in python?

  • How will you convert a string to a set in python?

  • How will you create a dictionary using tuples in python?

  • How will you convert an integer to a character in python?

  • What is the purpose of ** operator ?

  • Question:- What is the purpose of // operator?

  • Answer:-``// Floor Division` − The division of operands where the result is the quotient in which the digits after the decimal point are removed.

  • What is the purpose of is operator?

  • What is the purpose of not in operator?

  • What is the purpose break statement in python?

  • What is the purpose continue statement in python?

  • What is the purpose pass statement in python?

  • How will you capitalizes first letter of string?

  • How will you check in a string that all characters are alphanumeric?

  • How will you check in a string that all characters are digits?

  • How will you check in a string that all characters are in lowercase?

  • How will you check in a string that all characters are numerics?

  • How will you check in a string that all characters are whitespaces?

  • How will you check in a string that it is properly titlecased?

  • How will you check in a string that all characters are in uppercase?

  • How will you get the length of the string?

  • How will you convert a string to all lowercase?

  • How will you remove all leading whitespace in string?

  • How will you get the max alphabetical character from the string?

  • How will you get the min alphabetical character from the string?

  • How will you change case for all letters in string?

  • How will you convert a string to all uppercase?

  • What is the difference between del() and remove() methods of list?

  • What is the output of len([1, 2, 3])?

  • What is the output of [1, 2, 3] + [4, 5, 6]?

  • What is the output of ['Hi!'] * 4?

  • What is the output of 3 in [1, 2, 3]?

  • What is the output of for x in [1, 2, 3]: print x?

  • What is the output of L[2] if L = [1,2,3]?

  • What is the output of L[-2] if L = [1,2,3]?

  • What is the output of L[1:] if L = [1,2,3]?

  • How will you compare two lists?

  • How will you get the length of a list?

  • How will you get the max valued item of a list?

  • How will you get the min valued item of a list?

  • How will you get the index of an object in a list?

  • How will you insert an object at given index in a list?

  • How will you remove last object from a list?

  • How will you remove an object from a list?

  • How will you reverse a list?

  • How will you sort a list?