[SOLVED] CSCI161 Assignment 3

25.00 $

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

You will receive the following solution file(s) instantly after successful payment:

zip file icon assignment03-u85xn5.zip (360.5 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

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