Viva Therika Vidrom
Viva Therika Vidrom
1. What is Python?
- An interpreter executes code line by line, while a compiler converts the whole program into machine code at
once.
3. What is a variable?
4. What is a constant?
- Reserved words with special meanings in Python, e.g., if, for, while.
- Specifies the kind of data a variable can hold, e.g., int, float, str.
8. What is a string?
- A placeholder that does nothing and is used to maintain the structure of a program.
- The value that a function sends back after execution using the return statement.
- Arguments that take predefined values if no value is provided during function call.
- A file containing Python code that can be imported into another program.
- Simplifies file handling and ensures files are properly closed after operations.
- An instance of a class.
- A feature that allows a class to inherit properties and methods from another class.
- A feature that allows a function or method to behave differently based on input or context.
44. What is an iterator?
52. What is the difference between a shallow copy and a deep copy?
- Shallow Copy: Creates a new object but references the original elements.
- Deep Copy: Creates a new object and recursively copies all elements.
53. What is the purpose of the is operator?