- What is Python?
Answer: Python is a high-level, interpreted, object-oriented programming language. It is designed to be easy to read and write. Python is widely used in web development, automation, artificial intelligence, data science, and software development. Python syntax is simple and similar to English, making it beginner-friendly. - Who developed Python?
Answer: Python was developed by Guido van Rossum in 1991 at CWI (Netherlands). He created Python to make programming simple and readable. - Why is Python called an interpreted language?
Answer: Python is called an interpreted language because the Python interpreter executes code line-by-line instead of compiling the entire program at once. This makes debugging easier. - What are the main features of Python?
Answer:- Easy to learn and use
- Interpreted language
- Object-oriented
- Portable
- Large standard library
- Free and open source
- What is Python syntax?
Answer: Syntax refers to the rules that define how Python code must be written. Python uses indentation instead of braces to define code blocks. - What is indentation?
Answer: Indentation refers to spaces at the beginning of a line. It is used to define blocks of code in Python such as loops and functions. - What is a variable?
Answer: A variable is a container used to store data values. Example: x = 10 - How do you create a variable in Python?
Answer:x = 10 name = "Python"
- What are keywords?
Answer: Keywords are reserved words in Python that have special meaning. Example: if, else, while, def, class. - Is Python case-sensitive?
Answer: Yes, Python is case-sensitive. Example: Name and name are different variables. - What are data types?
Answer: Data types define the type of value stored in a variable. Example: int, float, string, list. - What is int data type?
Answer: int is used to store integer values such as 10, 20, 100. - What is float data type?
Answer: float is used to store decimal values such as 10.5, 20.3. - What is string?
Answer: String is used to store text inside quotes. Example: “Hello” - What is list?
Answer: List is a collection of multiple values and it is mutable (can be changed). - What is tuple?
Answer: Tuple is a collection of values but it is immutable (cannot be changed). - What is set?
Answer: Set is a collection of unique values. - What is dictionary?
Answer: Dictionary stores data in key-value pairs. - What is bool?
Answer: Bool stores True or False values. - How to check data type?
Answer:type(x)
- What is an operator?
Answer: Operator is used to perform operations on variables and values. - What are arithmetic operators?
Answer: +, -, *, /, % - What are comparison operators?
Answer: ==, !=, >, < - What are logical operators?
Answer: and, or, not - What is assignment operator?
Answer: = operator is used to assign values. - What is if statement?
Answer: if statement is used to check conditions. - What is else statement?
Answer: else executes when if condition is false. - What is elif?
Answer: elif is used to check multiple conditions. - What is loop?
Answer: Loop is used to repeat code multiple times. - Types of loops in Python?
Answer:- for loop
- while loop
- What is function?
Answer: Function is a block of reusable code. - How to create function?
Answer:def myfun(): print("Hello") - What is parameter?
Answer: Parameter is input given to function. - What is return?
Answer: return sends value back from function. - What is lambda function?
Answer: Lambda is anonymous function. - What is class?
Answer: Class is blueprint of object. - What is object?
Answer: Object is instance of class. - What is constructor?
Answer: Constructor is special function called automatically. - What is inheritance?
Answer: Inheritance allows child class to use parent class properties. - What is polymorphism?
Answer: Same function behaves differently. - What is exception?
Answer: Exception is error during execution. - What is try block?
Answer: try block is used to test code. - What is except block?
Answer: except handles errors. - What is finally block?
Answer: finally always executes. - What is file handling?
Answer: File handling is used to read and write files. - How to open file?
Answer:open("file.txt","r") - What is module?
Answer: Module is file containing Python code. - What is pip?
Answer: pip installs Python packages. - What is iterator?
Answer: Iterator is object used to loop over data. - What is generator?
Answer: Generator returns iterator using yield. - What is decorator?
Answer: Decorator modifies function behavior. - What is memory management?
Answer: Python manages memory automatically. - What is garbage collection?
Answer: Removes unused objects from memory. - What is mutable object?
Answer: Mutable objects can be changed. Example: list. - What is immutable object?
Answer: Immutable objects cannot be changed. Example: string, tuple. - What is slicing?
Answer: Extracting part of sequence. - What is range()?
Answer: range() generates sequence of numbers. - What is global variable?
Answer: Declared outside function. - What is local variable?
Answer: Declared inside function. - What is scope?
Answer: Scope defines accessibility of variable. - What is pass statement?
Answer: pass is empty statement. - What is break statement?
Answer: break stops loop. - What is continue statement?
Answer: continue skips iteration. - What is docstring?
Answer: Docstring documents function. - What is library?
Answer: Library is collection of modules. - What is framework?
Answer: Framework provides structure to build applications. - What is PEP?
Answer: Python Enhancement Proposal defines standards. - What is syntax error?
Answer: Error caused by incorrect syntax. - What is runtime error?
Answer: Error during execution. - What is logical error?
Answer: Error in logic. - What is __name__ variable?
Answer: Shows if file is main program or imported. - Why Python is popular?
Answer: Easy syntax, powerful libraries, used in AI, web, data science.
📢 Join Our WhatsApp Channel
💼 Get Daily IT Job Updates, Interview Preparation Tips & Instant Alerts directly on WhatsApp.
👉 Join WhatsApp Now📢 Join Our Telegram Channel
💼 Get Daily IT Job Updates, Interview Tips & Exclusive Alerts directly on Telegram!
👉 Join Telegram