Untitled Document
Untitled Document
**Benefits of Python:**
1. Easy to read and w
2. Extensive libraries and frameworks.
3. High compatibility with other languages.
4. Robust community support.
5. Ideal for beginners and experts alike.
6. Supports multiple paradigms (e.g., OOP, functional).
7. Great for web and app development.
8. Essential in data science and AI.
9. Platform-independent.
10. Effective for rapid prototyping.
print("Integer:", a)
print("Float:", b)
print("Complex:", c)
```
---
Answer: **False**
**Justification**: Due to floating-point precision errors, `0.1 + 0.2` does not exactly equal
`0.3` in binary representation.
**Justification**: All given options (_x, __x, __xyz__) are valid in Python.
print("Addition:", a + b)
print("Subtraction:", a - b)
print("Multiplication:", a * b)
print("Division:", a / b)
print("Modulus:", a % b)
print("Exponent:", a ** b)
print("Floor Division:", a // b)
```
---
You can convert a string representing Python code into an object using `eval()` (use with
caution for safety):
```python
obj = eval("42")
print(obj)
```
# List operations
my_list = [1, 2, 3]
my_list.append(4)
print("After append:", my_list)
my_list.remove(2)
print("After remove:", my_list)
```
---
**Answer**: Yes. Strings in Python are immutable, meaning once created, they cannot be
modified. Any operation on a string creates a new one.
---
**Justification**: `int`, `float`, and `complex` are all numeric data types in Python.
**Justification**: To access a key’s value in a dictionary, use square brackets with the key
name as a string, `d["Vaagai"]`.