You are on page 1of 10

Programming for Beginner

PROGRAMS
Faculty of
Management
Prepared By :- RAHUL POPAT Studies
Course:- B.COM (HONS.) SEM – 3
Enrolment No. :- 92100458007
Outline
Two Program
1. Write the Python Program to Check Whether the
Number is Positive, Zero or Negative.
2. Write the Python Program to find out Maximum of
Three Number.
1. Write the Python Program to Check Whether
the Number is Positive, Zero or Negative.

This program is of if...elif...else Statement


Syntax:
if test expression:
Body of if
elif text expression:
Body of elif
else:
Body of else
Flowchart of if...elif...else
Input

• num = float(input(“Enter a number:”))


• if num > 0:
• print(“It is positive number”)
• elif num == 0:
• print(“It is Zero”)
• else:
• print(“It is negative number”)
Output

• Output 1
• Enter a number : 2.4
• Positive number
• Output 2
• Enter a number : 0
• Zero
• Output 3
• Enter a number : -12
• Negative number
2. Write the Python Program to find out Maximum
of Three Number.

• This program is of max() function


Syntax:

max(n1, n2, n3, ...)


Input

• a = 5
• b = 15
• c = -100
• x = max(a, b, c)
• print(x)
Output

• 15
Thank You

You might also like