CSCI161 Assignment 3 Solved

25.00 $

Category: Tags: , ,
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

Rate this product

Objective:

To work with loops (for and while), break and continue in python.

Assignment:

  1. Input a number from the user and find the sum of all numbers starting from 1 to the given input using while loop.
  2. Input a number and check if it is prime or not using for loop.
  3. Input two numbers (first number should be smaller than second, otherwise show error message) and print all odd numbers between the given input numbers using while loop.
  4. Assign a string “CSCI161L” to a variable and print “CSCI” only using break statement.
  5. Print the numbers from 1 to 20 excluding 5, 10, 15 using continue statement.

Sample output:

Instructions:

 Preferred programming environment:

 OS
 Interpreter  Editor

: Linux (Mint)
: Python 3 (not Python 2)
: gedit or editor of your choice

 The program is saved as a file with .py extension.

 The program should include a comment block at the top with your name, course number and course section, assignment number

  • assignment03-u85xn5.zip