Starting from:

$30

COM1001 Lab 1 -Solved

A prime number (or prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself. 

Write a  Python program   which   takes     a  set  of   positive numbers  from the   input  and   returns the    sum  of   the   prime   numbers    in    the    given        set.   The sequence     will  be  ended   with  a   negative       number.              

I/O Format: 

Input format: [numbers]*[Space]<nega1ve number>

Output format:<sum_of_primes>

Note that: 

1-  Sample input and output files are provided.

2-  [x]* means, zero or more elements of x

More products