You are on page 1of 8

PART – B

Objective:

To become familiar with python language programs.

1. Construct a program to determine whether the input number is odd or even.

Source Code:

Output:
2. Construct a program to determine whether the input number is positive or negative.

Source Code:

Output:
3. If your salary is more than Rs.10,000 & you are owing a car than you are of "executive
grade”, but if you are not owing a car than you are simply an "officer grade" even if your
salary is more than 10,000. Construct a program to assess and print your category.

Source Code:

Output:
4. If your percentage is between 50 & 60, than your grade is D, if between 60 & 70 than 'C',
if between 70 & 80 than 'B', if between 80 & 90 than 'A'. Write a program to assess your
grade. Construct a program with if-else and logical operators both.

Source Code:

Output:
5. Construct a program to give discount of 20% if age is less than 15 or greater than 60 to
customer other wise gives only 5% discount.

Source Code:

Output:
6. Construct a program which produces the following design pattern using nested loop.

**

***

****

*****

Source Code:

Output:
7. Construct and implement a program of your own choice showing the implementation of
decision making statement.

Source Code:

Output:
8. Construct and implement a program of your own choice showing the implementation of
looping structure.

Source Code:

Output:

You might also like