Top 100 Frequently asked python interview questions

Posted on by Sumit Kumar

1)How to get user input in Python

2)Write Python Program to Find the Square Root

3)Write  Python Program to Calculate the Area of a Triangle

4)Write Python program to swap two variables with and without using temp variable.

5)Write Python program to check if a number is positive or negative

6)Write Python Program to Check if a Number is Odd or Even

7)Write Python Program to Find the Largest Among Three Numbers

8)Write Python Program for simple interest

9)Write Python Program for compound interest

10)Write  Python Program to Convert Celsius To Fahrenheit(C*1.8=F-32S)

11)Write  Python Program to Check Leap Year

12)Write Python program to convert Decimal to binary

13)Write Python program to add two binary numbers

14)Write Python program to generate a random number

15)Write Python program to display calendar

16)Write Python program to interchange first and last elements in a list

17)Write Python program to remove Nth occurrence of the given word

18)Write Python program to find length of list

19)Python program to check if element exists in list

20)Write Python program to Reversing a List

21)Write Python program to Cloning or Copying a list

22)Write Python program to Count occurrences of an element in a list

23)Write Python program to find sum of elements in list

24)Write Python program to Multiply all numbers in the list

25)Write Python program to find smallest number in a list

26)Write Python program to find largest number in a list

27)Write Python program to find second largest number in a list

28)Write Python program to find N largest elements from a list

29)Write Python program to print even numbers in a list

30)Write Python program to print odd numbers in a List

31)Write Python program to print positive numbers in a list

32)Write Python program to print negative numbers in a list

33)Write Python program to print all even numbers in a range

34)Write Python program to print all odd numbers in a range

35)Write Python program to count Even and Odd numbers in a List

36)Write Python program to count positive and negative numbers in a list

37)Write Python program to Remove duplicate elements from a list in Python

38)Write Python program to Break a list into chunks of size N in Python

39)Write Python program to check whether the input character is an alphabet

40)Write Python program to check vowel or consonant

41)Write Python program to calculate length of a string

42)Write Program to print ASCII Value of a character

43)Write Python Program to Check Whether a String is Palindrome or Not

44)Write Python Program to Remove Punctuations From a String

45)Write Python Program to Sort Words in Alphabetic Order

46)Write Python Program to Count the Number of Each Vowel

47)Write Python Program to Reverse words in a given String in Python

48)Write Python Program to remove n’th character from string in Python

49)Write Python Program to Check if a Substring is Present in a Given String

50)Write Python program to print even length words in a string

51)Write Python program to accept the strings which contains all vowels

52)Write Python program to Count the Number of matching characters in a pair of string

53)Write Python program to Remove all duplicates from a given string in Python

54)Write Python program to find words which are greater than given length n

55)Write Python program to split and join a string

56)Write Python program find all close matches of input string from a list

57)Write Python program to find uncommon words from two Strings

58)Write Python program to find all duplicate characters in string

59)Write Python program to illustrate String slicing.

60)Using Counter find all duplicate characters in string

61)Write Python Program to Find the Sum of Natural Numbers

62)Write Python Program to Find the Factors of a Number

63)Write Python Program to Check Prime Number

64)Write Python Program to Print all Prime Numbers in an Interval

65)Write Python Program to Print the Fibonacci sequence

66)Write Python Program to Check Armstrong Number

67)Write Python Program to Find Armstrong Number in an Interval

68)Write Python Program to Find HCF or GCD

69)Write Python Program to Find LCM

70)Write Python Program to Sort  Dictionaries by Key or Value

71)Write Python Program to Reverse a Dictionary

72)Write Python Program to Merging two Dictionaries

73)Write Python program to find the sum of all items in a dictionary

74)Write Python program to find winner of election using Dictionary and counter in Python

75)Write Python program to convert a list of Tuples into Dictionary

76)Write Python program to Check order of character in string using OrderedDict( )

77)Write Python program to Find common elements in three sorted arrays by dictionary
intersection

78)Write Python program to remove all duplicates words from a given sentence

79)Write Python Program for Linear Search and Binary Search

80)Write  Python Program for Selection Sort and Bubble Sort

81)Write Python Program to Display Fibonacci nth number Using Recursion

82)Write Python Program for Find sum of odd factors of a number

83)Write Python Program for Find sum of even factors of a number

84)Write Python Program for Find largest prime factor of a number

85)Write Python Program for Efficient program to print all prime factors

86)Write a Python program to read an entire text file

87)Write a Python program to read first n lines of a file.

88)Write a Python program to append text to a file and display the text

89)Write a Python program to read last n lines of a file.

90)Write a Python program to read a file line by line and store it
into a list.

91)Write a Python program to copy the contents of a file to another file

92)Write a python program to find the longest words.

93)Write a Python program to count the number of lines in a text file

94)Write a Python program to count the frequency of words in a file

95)What is the difference between list and tuples.

96)Explain deep copy and shallow copy.

97)What is iterable and iterator in python.

98)What is generator in python.

99)Difference between iterator and generator in python

100)Explain decorators in python with real time use case.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*