Question: Write a python program to sum of all the positive integers that are not bigger than n ( i . e . n ) and

Write a python program to sum of all the positive integers that are not bigger than n(i.e.n) and are not divisible by 3(%30) after accepting the value of integer n from the user keyboard. The python program should also account for the case when the user
enters a negative number.
Below are some testing examples
Enter a positive integer:0
You have entered an invalid number. Exiting the program.
Enter a positive integer:-2
You have entered an invalid number. Exiting the program.
Enter a positive integer:1
The sum of the first 1 positive integers is 1
Enter a positive integer:5
The sum of the first 5 positive integers is 12
Enter a positive integer: 10
The sum of the first 10 positive integers is 37
 Write a python program to sum of all the positive integers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!