[SOLVED] COM1001 Lab 1

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

Rate this product

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:

  • Sample input and output files are provided.
  • [x]* means, zero or more elements of x
Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.