Sai Unsolved Questions Getting Started With Python 11B
Sai Unsolved Questions Getting Started With Python 11B
Sai Unsolved Questions Getting Started With Python 11B
Unsolved Questions:
Repeat 5 times:
Read result of coin flip (1 for player 1 win, 2 for player 2
win)
If result == 1:
Increment player1_wins
Else:
Increment player2_wins
If player1_wins == 3:
Display "Player 1 wins the cake"
Exit loop
If player2_wins == 3:
Display "Player 2 wins the cake"
Exit loop
```
Display aggregate_marks
Display percentage
```
largest = num1
smallest = num1
Display factorial
```
24. **In how many different ways can you work in Python?
**
- In Python, you can work in several ways:
1. Interactive mode (Python Shell)
2. Script mode (using Python scripts or programs)
3. Integrated Development Environments (IDEs) like
IDLE, PyCharm, etc.
4. Jupyter Notebooks for interactive data analysis and
visualization
5. Command-line execution for quick scripts
- **Disadvantages:**
- Limited for larger programs: Not suitable for
developing complex applications due to lack of file
organization.
- Lack of persistence: Code isn't saved automatically
unless manually copied to a script.
- Hard to reproduce: Difficult to recreate exact
sequences of commands for documentation or sharing.
>>> print(3.14159 * 7)
21.99113