TGViewer
Artificial Intelligence Artificial Intelligence @machinelearning_deeplearning · 56.3K subscribers
Post #1389 2.01K
Python Interview Questions – Part 1

1. What is Python?
Python is a high-level, interpreted programming language known for its readability and wide range of libraries.

2. Is Python statically typed or dynamically typed?
Dynamically typed. You don't need to declare data types explicitly.

3. What is the difference between a list and a tuple?

List is mutable, can be modified.

Tuple is immutable, cannot be changed after creation.


4. What is indentation in Python?
Indentation is used to define blocks of code. Python strictly relies on indentation instead of brackets {}.

5. What is the output of this code?

x = [1, 2, 3]
print(x * 2)

Answer: [1, 2, 3, 1, 2, 3]

6. Write a Python program to check if a number is even or odd.

num = int(input("Enter number: "))
if num % 2 == 0:
print("Even")
else:
print("Odd")

7. What is a Python dictionary?
A collection of key-value pairs. Example:

person = {"name": "Alice", "age": 25}

8. Write a function to return the square of a number.

def square(n):
return n * n


Coding Interviews: https://whatsapp.com/channel/0029VammZijATRSlLxywEC3X

ENJOY LEARNING 👍👍
  • ❤ 4
More from @machinelearning_deeplearning
  1. Sep 22, 2026🚀 Welcome back to our AI Engineer Roadmap! ❤️ In the previous posts, we learned about fun…
  2. Sep 21, 2026🚀 Welcome back to our AI Engineer Roadmap! ❤️ In the previous post, we explored functions…
  3. Sep 20, 2026In the previous post, we learned how conditional statements allow Python programs to make…
  4. Sep 19, 2026In the previous post, we explored Python operators and even tested ourselves with some tri…
  5. Sep 18, 2026In the previous post, we learned how to convert one data type into another using Type Cast…
  6. Sep 17, 2026In the previous post, we learned how to take input from users and display output. One impo…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →