Skip to content

Commit 903fc61

Browse files
Update README.md
1 parent 2943014 commit 903fc61

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

week_3/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,71 @@ Bitwise operators perform operations on the binary representations of integers.
7171

7272
## Practice Questions and Resources
7373

74+
### 🭝 Python Operations - Practice Questions
75+
76+
This document contains practice questions to help you strengthen your understanding of **Python operators**, including:
77+
78+
- Arithmetic Operators (`+`, `-`, `*`, `/`, `//`, `%`, `**`)
79+
- Comparison Operators (`==`, `!=`, `>`, `<`, `>=`, `<=`)
80+
- Logical Operators (`and`, `or`, `not`)
81+
- Assignment Operators (`=`, `+=`, `-=`, etc.)
82+
- Bitwise Operators (`&`, `|`, `^`, `~`, `<<`, `>>`)
83+
84+
---
85+
86+
## ✅ Arithmetic Operators
87+
88+
1. Write a program that takes two numbers from the user and displays the result of all arithmetic operations.
89+
2. Calculate the area and perimeter of a rectangle using arithmetic operators.
90+
3. Find the square root and cube of a number using `**`.
91+
4. Convert total seconds into hours, minutes, and seconds using `//` and `%`.
92+
93+
---
94+
95+
## ✅ Comparison (Relational) Operators
96+
97+
1. Write a program to compare two numbers and print which one is greater.
98+
2. Check if a person is eligible to vote (age >= 18).
99+
3. Take input from the user and check if it is a positive, negative, or zero.
100+
4. Compare the lengths of two strings and print if they are equal.
101+
102+
---
103+
104+
## ✅ Logical Operators
105+
106+
1. Check if a number is between 1 and 100 (inclusive).
107+
2. Write a program to check if a year is a leap year using logical conditions.
108+
3. Take three subject marks from the user and check if the student has passed all subjects (passing marks >= 40).
109+
4. Ask the user if they are "registered" and "logged in". Allow access only if both conditions are true.
110+
111+
---
112+
113+
## ✅ Assignment Operators
114+
115+
1. Take a number and update its value using `+=`, `-=`, `*=`, `/=`, etc.
116+
2. Write a calculator that performs operations and updates the value step by step using assignment operators.
117+
3. Create a counter that starts at 0 and increments/decrements based on user input.
118+
119+
---
120+
121+
## ✅ Bitwise Operators
122+
123+
1. Perform bitwise AND, OR, XOR between two integers and print the result.
124+
2. Show how left shift (`<<`) and right shift (`>>`) work with an example.
125+
3. Write a program that checks if a given number is even or odd using bitwise AND.
126+
4. Take two numbers and perform all bitwise operations on them.
127+
128+
---
129+
130+
## 💡 Bonus Challenges
131+
132+
1. Simulate a simple login system using logical operators.
133+
2. Write a program to swap two numbers without using a third variable (hint: use arithmetic or bitwise operators).
134+
3. Use all types of operators in a single program that acts like a mini calculator.
135+
136+
---
137+
138+
> 🚀 Happy Coding! Practice these questions and level up your Python fundamentals.
74139
- **Practice Questions**: [HackerRank Python Practice](https://www.hackerrank.com/domains/tutorials/10-days-of-python)
75140
- **YouTube Channel**: [My Python Playlist](https://www.youtube.com/playlist?list=PLX1eV90xXed2wujMJKUdsWQu2UMS9ROGO)
76141

0 commit comments

Comments
 (0)