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

Practical Assignment 1-Ques

1. The document provides 22 programming assignments for a Computer Science class involving operations on numeric and string data types in Python. The assignments involve tasks like calculating mathematical operations on numbers, marks percentages, simple interest, area and perimeter calculations, temperature conversions, and string manipulations. 2. Students are asked to write Python scripts to accept user input and display appropriate outputs with messages for tasks like adding/multiplying numbers, calculating exam marks and percentages, simple interest calculation, and operations on shapes. 3. Other assignments involve conversions between time, temperature, distance units and string manipulations like adding characters, displaying names and subjects in specified formats.

Uploaded by

Vishesh Aggarwal
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)
179 views2 pages

Practical Assignment 1-Ques

1. The document provides 22 programming assignments for a Computer Science class involving operations on numeric and string data types in Python. The assignments involve tasks like calculating mathematical operations on numbers, marks percentages, simple interest, area and perimeter calculations, temperature conversions, and string manipulations. 2. Students are asked to write Python scripts to accept user input and display appropriate outputs with messages for tasks like adding/multiplying numbers, calculating exam marks and percentages, simple interest calculation, and operations on shapes. 3. Other assignments involve conversions between time, temperature, distance units and string manipulations like adding characters, displaying names and subjects in specified formats.

Uploaded by

Vishesh Aggarwal
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

Computer Science (083)

Class XI (2020-21)
Assignment No. 1 – Operations on Numeric and string data type

Note: Programming language – Python


Take the input and display the result with appropriate message. Use proper
name of the variables.
Write the statements with first column (Do not indent them).

1. Write a Python script to accept two numbers and display their addition, difference, product,
division, integer division, remainder and exponent (raise to power).

2. Write a Python script to accept marks in three subjects (out of 100) and display itstotal marks and
percentage.

3. Write a Python script to accept principal amount, rate of interest and time in yearsand display
simple interest. Note: S = PRT / 100

4. Write a Python script to accept a number and display square and cube of a number.

5. Write a Python script to accept side of a square and display its area and perimeter.

6. Write a Python script to accept length and breadth of a rectangle and display its areaand perimeter.

7. Write a Python script to accept radius of a circle and display its area andcircumference.

8. Write a Python script to accept base and height of a triangle and display its area.

(Area = ½ * b * h)

9. Write a Python script to accept three sides of a triangle and calculate its area usingHeron’s
formula.

s = (a + b + c) / 2 A = √𝑠∗(𝑠−𝑎)∗(𝑠−𝑏)∗(𝑠−𝑐)

10. Write a Python script to accept temperature in Fahrenheit and display it in Celsius. C =( F – 32) *
5/9

11. Write a Python script to accept temperature in Celsius and display it in Fahrenheit.

F = C * 9/5 + 32

12. Write a Python script to accept time in minutes and display corresponding time in hours and
minutes. Example, if Input is 75 minutes, the output is 1 hour 15 minutes.
13. Write a Python script to accept the height in inches and display it in feet and inches.

14. Write a Python script to swap (interchange the value) of two numbers. Display twonumbers with
memory location before and after swapping.

15. Write a Python script input a number and assign this number to three variables. Display three
variables with memory location.

16. Write a Python script to input a string and display it with a # at the end.
Input: Courage is grace under Pressure #Output: Courage is grace
under Pressure#

17. Write a Python script to accept marks in five subjects display the following outputusing a single
print statement.
Example, if the input numbers are 90 70 69 77 99, then output is
Mathematics = 90 English = 70 Science = 69 Social Studies = 77 Sanskrit = 99

18. Write a Python script to accept your name, class, section and display the output inthe following
manner:
NAME: < yourname>
CLASS: < Your class> SECTION: < Your section>

19. Write a Python script to display the following message on thescreen

a) "The professor said, "Please don't sleep in the class'"


# b) "Opportunities don't happen. You create them." Try not to become a person of "success" but try to become a person
of "value"

20. Write a Python script to accept first name, middle name and last nameand display the
full name. For example,
Input Output
first name is Ankit Ankit Kumar Jainmiddle name is
Kumar
last name is Jain

21. Write a Python script to accept your name and a number. Display your name somany times on
the screen.
Input Output
Name is Ankit AnkitAnkitAnkit
Number is 3
22. Write a Python script to accept five subjects you have taken in class 11 and display allthe subjects
with * sign between them. For example,
Input
ENGLISH, MATHS, PHYSICS, CHEMISTRY, COMPUTER SCIENCE
Output
ENGLISH*MATHS*PHYSICS*CHEMISTRY*COMPUTER SCIENCE

You might also like