0% found this document useful (0 votes)
23 views2 pages

Lab Programming Assignment - 1

The document provides instructions for 4 programming assignments in Python for a software development course. The first assignment involves familiarizing students with basic Python features like data types, I/O, operators, and using the interpreter. The second assignment asks students to write programs to calculate travel time given distance and speed, and to convert between Celsius and Fahrenheit temperatures. The third assignment involves writing a program to calculate bills for multiple items with quantity, price, discount, and tax. The fourth assignment requires converting between RGB and CMYK color codes using given formulas.

Uploaded by

sreenethi2370068
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Lab Programming Assignment - 1

The document provides instructions for 4 programming assignments in Python for a software development course. The first assignment involves familiarizing students with basic Python features like data types, I/O, operators, and using the interpreter. The second assignment asks students to write programs to calculate travel time given distance and speed, and to convert between Celsius and Fahrenheit temperatures. The third assignment involves writing a program to calculate bills for multiple items with quantity, price, discount, and tax. The fourth assignment requires converting between RGB and CMYK color codes using given formulas.

Uploaded by

sreenethi2370068
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ICS1261 – Software Development and Practice using Python

Practice using Python Lab Assignments


Batch: 2023-2028 Course: 5 Year Integrated M.Tech(CSE) AY: 2023-24 (EVEN)

Programming Assignment – 1 : Learning Python – Interactive Mode and Simple Python Programs (CO7,K3)

20.2.2024

Learning Outcomes:
You will be able to familiarize the following basic features of Python
 Data type declarations
 I/O statements
 Operators and expressions
 Python as Interpreter

Interactive Mode
1. Create a variable named num1 with some integer value and display the value & its datatype.

2. Create another variable named num2 with some integer value and display its datatype. Use the same
variable to store a floating value and write your inference.

3. Create a variable name with your name as input

4. Display the value of num1, num2 and name.

5. Display the type of num1, num2 and name.

6. Display “Hello “along with your name.

7. Find the output of 4+6*7 /2 directly.

8. Find the output of 4+5*7 /3 directly.

9. Find the output of 4+5*7 //3 directly.

10. Find the output of num1 raised to power of num2 11. Get the input from the user and display the
value.

Simple Python Programs

1. Anjana is traveling from city P to city Q. The distance between the two cities is a variable obtained as input,
because she would like to use the equation for other cities also. She knows that she will be travelling 3/4th of
the distance at a speed of 40 miles per hour, and that the remaining will be travelled at 55 miles per hour.
Calculate the time that it will take to travel from one city to the next.

2. Develop a temperature conversion utility as part of a weather data processing system. The utility will be
used to convert temperature data between Celsius and Fahrenheit units to ensure consistency in temperature
measurements for meteorological data analysis. The program should have the following features:
a. Should accept a temperature value and unit identifier (Celsius or Fahrenheit) as input and compute the
temperature value in the opposite unit.
b. Ensure the temperature conversions are accurate to at least one decimal place to maintain precision in
weather analysis.

3. Develop a program to calculate the bill amount for items in an online shopping cart. The program should
allow users to input the following details for each item:
• Quantity sold
• Item value (price per unit)
• Discount percentage
ICS1261 – Software Development and Practice using Python
Practice using Python Lab Assignments
Batch: 2023-2028 Course: 5 Year Integrated M.Tech(CSE) AY: 2023-24 (EVEN)
• Tax rate
The program should then calculate and display the detailed bill summary, including the total before tax,
discount amount, tax amount, and the final bill amount.
The bill should be in the following format:
******************* BILL **********************
Quantity Sold: 20
Price per item: Rs.300
***********************************************
Amount: Rs.6000
***********************************************
Discount: Rs. 600
Discounted Total: Rs.5400
Tax: Rs. 648
***********************************************
Total Amount Rs.6048
***********************************************

4. In digital world colors are specified in Red-Green-Blue (RGB) format, with values of R, G, B varying on an
integer scale from 0 to 255. In print publishing the colors are mentioned in Cyan-Magenta-Yellow-Black (CMYK)
format, with values of C, M, Y, and K varying on a real scale from 0.0 to 1.0. Write a program that converts RGB
color to CMYK color as per the following formulae:

𝑊ℎ𝑖𝑡𝑒 = max , , , 𝐶𝑦𝑎𝑛 =

𝑀𝑎𝑔𝑒𝑛𝑡𝑎 = , 𝑌𝑒𝑙𝑙𝑜𝑤 = , 𝐵𝑙𝑎𝑐𝑘 = 1 − 𝑊ℎ𝑖𝑡𝑒

Note: If the RGB values are all 0, then the CMY values are all 0 and the K value is 1.

You might also like