diff --git a/Bonus.py b/Bonus.py new file mode 100644 index 0000000..e5a8a2c --- /dev/null +++ b/Bonus.py @@ -0,0 +1,9 @@ + +n = int(input("Enter positive number :")) +total = 0 +for i in range (1 , n+1): + if i%2==0: + total=total+i + print(total) +print(f'the sum between 1 and {n}is {total}') + diff --git a/lab_loops.py b/lab_loops.py new file mode 100644 index 0000000..af67196 --- /dev/null +++ b/lab_loops.py @@ -0,0 +1,16 @@ + +numbers = range(45,210) +for n in numbers: + if n ==100: + continue + elif n ==205: + break + print(n) + +print('the number is end') + +user = "what is the product of 7 * 24 = " +while input(user) !="168": + print("Your Answer is wrong try again..") +else: + print("You answered this Question correctly")