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