Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bouns.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
print()
num = int(input("Enter Positive Integer:") )
Total= 0
for i in range(1, num + 1 ):
if i % 2 == 0:
Total += i

print("The sum of even numbers between 1 and", num, "is",Total)
25 changes: 25 additions & 0 deletions for_while_loop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# for loop

number_range = (45, 210)

for num in range(45, 210):

if num == 100:
continue

elif num == 205:
break

else:
print(num)

print()

# while loop

question = "What is the product of 7 * 24 ? "

while input(question) != "168":
print("Your answer is wrong, try again.")

print("You answered this Question correctly.")