0% found this document useful (0 votes)
103 views6 pages

Python Assignment

Uploaded by

srujityennam2006
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)
103 views6 pages

Python Assignment

Uploaded by

srujityennam2006
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

Name- Srujit Yennam

PRN- 12411627

[Link]- 61
Batch- B3

Ques on:1

Program to Calculate the Area of a circle and triangle Code:

Output:

Ques on:2

Program to Swap Two Variables Code:

Output:

Ques on:3
Program to Generate a Random Number Code:

Output:

Ques on:4

Program to Convert Kilometers to Miles Code:

Output:

Ques on:5

Program to find maximum of two numbers Code:

Output:
Ques on:6

Program to check if a number is even or odd Code:

Output:

Ques on:7

Program to check if a number is posi ve, nega ve or 0 Code:

Output:

Ques on:8
A school decided to replace the desks in three classrooms. Each desk sits two students. Given the
number of students in each class, print the smallest possible number of desks that can be purchased.
The program should read three integers: the number of students in each of the three classes, a, b and c
respec vely. In the first test there are three groups. The first group has 20 students and thus needs 10
desks. The second group has 21 students, so they can get by with no fewer than 11 desks.
11 desks is also enough for the third group of 22 students. So we need 32 desks in total.

Code:

Output:

Ques on:9

H hours, M minutes and S seconds are passed since the midnight (0 ≤ H < 12, 0 ≤ M < 60, 0 ≤ S < 60).

Determine the angle (in degrees) of the hour hand on the clock face right now.

Code:

Output:
Ques on:10

Given integer coordinates of three ver ces of a rectangle whose sides are parallel to the coordinate
axes, find the coordinates of the fourth vertex of the rectangle. In the first test the three given ver ces
are (1, 4), (1, 6), (7, 4). The fourth vertex is thus (7, 6).

Code:

Output:

Ques on:11

There was a set of cards with numbers from 1 to N. One of the card is now lost. Determine the number
on that lost card given the numbers for the remaining cards. Given a number N, followed by N − 1
integers - represen ng the numbers on the remaining cards (dis nct integers in the range from 1 to N).
Find and print the number on the lost card.
Code:

Output:

You might also like