Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

ASSIGNMENT 01

CS14950
Instructions:
1. You must submit individual code files for every question. Your files should be
named as follow:
<Your_Roll_No.>_CS14950_<AsgnNo>_<Question_Number>.py
For example: 21PY124_CS14950_Asgn02_Q2a.py
2. You must submit the code file in the following link:
www.CS14950_A1.com

Question 01:
Given an integer N, print all the prime numbers P such that P<N.
Sample:
Input: 9
Input-Type: Int
Output: [2,3,5,7]
Output-Type: List

Question 02:
a. Given a string in the form ‘54grams.’, print two lines as follows:
1. First line must give the measurement in metric system (lb., in.,
ft., F) .
2. Second line must give the measurement in SI units(kg, m, oC).
Sample:
Input: ‘54grams.’ Input-Type: str
Ouput:
54 grams in metric is: 0.119lbs.
54 grams in SI units is: 0.054kgs.
Output-Type: str
 Input can be in the following types: ‘grams, kgs, lbs, fts,
in., m., cms, F, K(kelvin), oC.’
 Use of library functions are allowed.

b. Solve problem Q2a without using any library functions.

You might also like