PYnative
pynative.com › home › python exercises
Python Exercises, Practice, Challenges [410+ Exercises] – PYnative
January 7, 2026 - Intermediate Python coding exercises primarily focuses on loops, strings, list, dictionary, sets, decorators, Generators (yield), OOP, and multi-threading, List/Dict comprehensions, and Lambda functions, File Handling, regular expression, Date and Time, other miscellaneous topics. ... Solve coding questions on input and output operations in Python.
Reddit
reddit.com › r/python › 40+ common code and interview problems solved in python (it's growing...)
r/Python on Reddit: 40+ Common code and interview problems solved in Python (it's growing...)
June 4, 2019 -
https://github.com/devAmoghS/Python-Interview-Problems-for-Practice
Top answer 1 of 5
7
I appreciate the effort made in collecting these, and they do serve as a great prompt to try solve some problems. However, having looked at a few examples, these should definitely not be used as best practice solutions!
2 of 5
6
Hmmm. The first one I looked at was the find only digits . # Given a string, check if it only contains digits def is_digit(input_str): digits = dict() for char in input_str: if char in digits: digits[char] += 1 else: digits[char] = 1 if sum(digits.values()) == len(input_str): return True else: return False result = is_digit("095357973590759530") print(result) # True I would do this: import re regex = re.compile(r"^\d+$") print("All digits") if regex.match('abc123') else print("Nope")
Newest 'python' Questions - Stack Overflow
Stack Overflow | The World’s Largest Online Community for Developers More on stackoverflow.com
What are some common Python questions you’ve been asked a lot in live coding interviews?
I ask about list vs tuple, why only immutable types are allowed as dict keys, what is GIL (if candidate seems advanced), i have a task to write a dict comprehension (surprised how many people know list comprehensions perfectly, but struggle with dict variety), a task to sort a list of strings by the string length - checking if they know there is the optional key param in sorted, but i give points if someone proposes a workaround. Mostly folks either know the expeced answer, or give up. Very few in between. I also have a more elaborate, interactive task to check their ability to write classes and work with @property/@....setter. By elaborate I mean we start simple and at each stage I add a complication, like "let's pretend addition is a very computationally expensive operation. How can we refactor this code to avoid unnecessary addition?". I might ask them what sorting algorithm is built into python, or how does python allocate memory when growing lists. More on reddit.com
40+ Common code and interview problems solved in Python (it's growing...)
I appreciate the effort made in collecting these, and they do serve as a great prompt to try solve some problems. However, having looked at a few examples, these should definitely not be used as best practice solutions! More on reddit.com
Where to practice for python interview ?
Here is a good catalog of Python interview questions More on reddit.com
Videos
03:18:08
Solving Leetcode Coding Interview Questions in Python! - YouTube
08:17
Complete Python Guide And 500+ Interview Questions And Solution ...
01:13:46
Top 25 Python Programming Interview Questions with code Explanations ...
Infosys Python Interview Questions | Hands-on Python Coding - YouTube
13:29
Top 5 Python Coding Interview Questions for 2025 | Problems ...
27:24
Python Interview Questions and Answers: Reverse a List from Index ...
GeeksforGeeks
geeksforgeeks.org › python › python-exercises-practice-questions-and-solutions
Python Exercise with Practice Questions and Solutions - GeeksforGeeks
2 weeks ago - This collection of Python coding practice problems is designed to help you improve your overall programming skills in Python. The links below lead to different topic pages, each containing coding problems, and this page also includes links to quizzes. You need to log in first to write your code.
GitHub
github.com › zhiwehu › Python-programming-exercises › blob › master › 100+ Python challenging programming exercises for Python 3.md
Python-programming-exercises/100+ Python challenging programming exercises for Python 3.md at master · zhiwehu/Python-programming-exercises
In case of input data being supplied to the question, it should be assumed to be a console input. ... Use re.findall() to find all substring using regex. ... Print a unicode string "hello world". ... Use u'strings' format to define unicode string. ... Write a program to read an ASCII string and to convert it to a unicode string encoded by utf-8. ... Use unicode() function to convert. ... Write a special comment to indicate a Python source code file is in unicode.
Author zhiwehu
Edureka
edureka.co › blog › interview-questions › python-interview-questions
Top Python Interview Questions and Answers (2025)
April 25, 2025 - These Python Interview Questions and Answers will help you prepare for Python job interviews. Start your preparation by going through the most frequently asked questions on Python. Ans:Inheritance allows One class to gain all the members(say attributes and methods) of another class. Inheritance provides code reusability, makes it easier to create and maintain an application.
DataCamp
datacamp.com › blog › top-python-interview-questions-and-answers
The 41 Top Python Interview Questions & Answers For 2026 | DataCamp
February 20, 2026 - Master 41 Python interview questions for 2026 with code examples. Covers basics, OOP, data science, AI/ML, and FAANG-style coding challenges.
UPES Online
upesonline.ac.in › blog › python-interview-questions-basics-and-advanced
50 Latest Python Interview Questions (Asked in 2026)
Simulates user interactions like clicking buttons and entering text. Requires additional libraries like Selenium WebDriver. ... Prepare with 15 Best Python Automation Interview Questions (with Code Examples). 1. Explain your approach to automating a simple web login workflow. Answer: Discuss identifying essential elements (username, password field, login button), using explicit waits to handle page loads, and capturing successful login confirmation.
Great Learning
mygreatlearning.com › blog › python exercises
Python Coding Practice Questions and Exercises
September 4, 2025 - 6.1 Palindrome Checker Write a function that checks if text reads the same backward and forward. Medium · 6.2 Prime Number Generator Write a function that returns a list of all prime numbers up to n. Medium · 6.3 Recursive Factorial Calculate factorial using recursion (function calling itself). Hard ... Validate your Python skills. Take our comprehensive Python quiz. Start Quiz · def greet(name): return f"Hi {name}!" # Run code instantly print(greet("User"))
Keka
keka.com › hr toolkit › interview questions › python coding interview questions and answers
Python coding interview questions and Answers | Keka
A candidate has to prepare himself by thoroughly understanding the data structures, syntax, and OOP. These Python interview questions help a jobseeker prepare for his interview: Write a program to print “Hello, World!”. By asking this question, interviewers aim to assess the candidate’s understanding of basic Python fundamentals. The difficulty level for this question is incredibly low. To display “Hello World!” in Python, we can use the print function. This is the following code: print(‘Hello World!’)
W3Schools
w3schools.com › python › python_interview_questions.asp
Python Interview Questions
A variable created inside a function belongs to the local scope of that function, and can only be used inside that function. A variable created in the main body of the Python code is a global ...
Dscet
dscet.ac.in › questionbank › science › first-sem › GE8151-PYTHON.pdf pdf
[Type text] GE8151- PROBLEM SOLVING AND PYTHON PROGRAMMING – Question Bank
statement of if block is executed otherwise it is skipped.Syntax of python if statement: ... When you do not want any code to execute, pass Statement is used.
Stack Overflow
stackoverflow.com › questions › tagged › python
Newest 'python' Questions - Stack Overflow
3 days ago - The function called writePDB from ProDy package takes a filename and a set of atoms as input. I have created two ... ... I'm trying to maintain a logged-in session using Python requests, but the cookies don't seem to persist across requests. Here is a simplified version of my code: import requests session = requests....
Internshala
internshala.com › home › job tips › interview guide › python coding interview questions
Top 45 Python Coding Interview Questions and Answers
January 10, 2025 - Familiarize yourself with the following coding questions that can enhance your confidence and demonstrate your enthusiasm for the language, making a positive impression on potential employers. Sample Answer: Here is a sample of how to write a Python program to check if a number is even or odd:
Analytics Vidhya
analyticsvidhya.com › home › 90+ python interview questions and answers (2026 edition)
90+ Python Interview Questions and Answers (2026 Edition)
We’ll also provide valuable Python interview questions and answers to help you prepare thoroughly for your next interview. Ans. We can convert a given string to an integer using a built-in function int(). e.g.- ... Ans. Below is the code to convert a string to a list in Python.
Published December 24, 2025
Analytics Vidhya
analyticsvidhya.com › home › 30 python coding interview questions for beginners
30 Python Coding Interview Questions for Beginners
May 1, 2025 - Completing practice with Python coding interview questions is essential for those who want to succeed in data science and software development positions. This extensive compilation addresses a broad range of basic ideas, from arithmetic operations and list manipulation to string manipulation. There are thorough answers for every query, complete with concise justifications and useful code ...
Programiz PRO
programiz.pro › community-challenges › python
Python Coding Challenges | Programiz PRO
Sharpen your Python skills with 600+ coding challenges and compete with other challengers to stay on the leaderboard. Available for all levels. Start Now.
Medium
medium.com › @nikitasilaparasetty › python-interview-coding-questions-with-solutions-for-beginners-7f6d782defac
Python Interview Coding Questions with Solutions for Beginners | by Nikita Silaparasetty | Medium
June 7, 2023 - Question 9: Write a Python program to find the second largest number in a list. ... def find_second_largest(numbers): largest = float('-inf') second_largest = float('-inf') for num in numbers: if num > largest: second_largest = largest largest = num elif num > second_largest and num != largest: second_largest = num return second_largest # Test the function nums = [10, 5, 8, 20, 3] second_largest_num = find_second_largest(nums) print(f"The second largest number is {second_largest_num}")