Question: Python 1. Write a program that prints all prime numbers up to 100. A prime number is a number which is not divisible by any

Python

1. Write a program that prints all prime numbers up to 100. A prime number is a number which is not divisible by any number prior to it. Example of prime numbers: 1, 3, 5, 7, 13, 17

Hint: divide the number by all numbers prior to it and see if the remainder is 0 for any one the divisions. If it is not, then this number is a prime number.

2. Write a program to find the sum of digits in given number.

Example: given number = 238176534, sum of digits = 39

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!