From 31f628cfaf251e9c0e04cd9995cba979565b72f7 Mon Sep 17 00:00:00 2001 From: FadhelAlmalki Date: Wed, 18 Feb 2026 13:50:49 +0300 Subject: [PATCH] added my solution --- bonus.py | 11 +++++++++++ range_function.py | 9 +++++++++ while_part.py | 8 ++++++++ 3 files changed, 28 insertions(+) create mode 100644 bonus.py create mode 100644 range_function.py create mode 100644 while_part.py diff --git a/bonus.py b/bonus.py new file mode 100644 index 0000000..7978c52 --- /dev/null +++ b/bonus.py @@ -0,0 +1,11 @@ +n = int(input("Enter a positive integer: ")) + +sum = 0 + +for number in range(1, n + 1): + if number % 2 == 0: + sum += number + +print(f"The sum of even numbers between 1 and {n} is {sum}.") + + diff --git a/range_function.py b/range_function.py new file mode 100644 index 0000000..beedf52 --- /dev/null +++ b/range_function.py @@ -0,0 +1,9 @@ +for number in range(45,211): + + if number == 100: + continue + + if number == 205: + break + + print(number) \ No newline at end of file diff --git a/while_part.py b/while_part.py new file mode 100644 index 0000000..b2c3598 --- /dev/null +++ b/while_part.py @@ -0,0 +1,8 @@ +while True: + answer = int(input("what is the product of 7 * 24? ")) + + if answer == 168: + print("You answered this Question correctly") + break + else: + print("Your Answer is wrong try again..") \ No newline at end of file