Starting from:

$30

CSCI161L Assignment 3 -Solved


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 
: Linux (Mint) 
 Interpreter 
: Python 3 (not Python 2) 
 Editor 
: 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 

More products