Interview questions

Python interview questions

168 questions. Tap “Show answer” to check yourself.

  1. Explain indexing and slicing operation in sequences

  2. What is a Lambda form? Explain about assert statement?

  3. Explain the role of repr function.

  4. Explain pickling and unpickling.

  5. What is LIST comprehensions features of Python used for?

  6. Explain the dictionary in Python.

  7. How do we share global variables across modules in Python?

  8. How can we pass optional or keyword parameters from one function to another in Python?

  9. Explain how python is interpreted.

  10. Is python the right choice for Web based Programming?

  11. Given a text file (FILE1) with lots of words (ex, an ebook), and another file (FILE2) with a list of blacklist words (slangs, porn, etc.), write a program to find the top 100 words(most frequent 100 words) from FILE1 which are not present in FILE2.

  12. Where can I get the study material for python

  13. What are the key features of Python?

  14. Which is better Python or ruby?

  15. Is Python similar to ruby?

  16. When is not a good time to use python generators?

  17. What does the list comprehension do?

  18. How do you check the presence of the key in python dictionary?

  19. How to run a Python CGI script in Wamp?

  20. Why does Python have a maximum recursion depth?

  21. What are some common uses of Pickling in Python?

  22. Print the length of each line in the file 'file.txt' not including any whitespaces at the end of the lines?

  23. Is there a switch or case statements in python?if not what is the reason for the same?

  24. Write a script to connect to MySql database using Python?

  25. What type of a language is python? Interpreted or Compiled?

  26. What is a CGI script in Python?

  27. What is composition in python?

  28. What is a metaclass in Python?

  29. Multiply all elements of a list without writing a loop?

  30. What is PEP8?

Companies that ask Python questions