0% found this document useful (0 votes)
7 views3 pages

Average of Three Numbers in Python

Here are also a few python codes
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Average of Three Numbers in Python

Here are also a few python codes
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Q 6: AVERAGE OF THREE

NUMBERS
[Link]

name = input('Enter your name: ')

print ('Enter the first number')

num1 = input()

print('Enter the second number')

num2 = input()

print('Enter the third number')

num3 = input()

average = float(int(num1) + int(num2) + int(num3)/3)

print('Thanks ',name,'\nThe average of the numbers is', round(average,2))

PYTHON CODE in IDLE Shell 3.12.4

Execution and Output in IDLE Shell 3.12.4


FLOWCHART FOR QUESTION 6

Start

INPUT

Name

INPUT

Number 1

INPUT

Number 2

INPUT

Number 3

Average = (Number 1 +
Number 2 + Number 3) / 3
OUTPUT

Average

Stop

Q 3: AREA OF A SQUARE
[Link]

print('Welcome to the calculator which derives the area of a square')

print('Please enter the length of the side in cm:')

square_side = input()

area = int(square_side) * int(square_side)

print('The area of square in square cm is:')

print(area)

PYTHON CODE in Shell 3.12.4

Execution and Output in IDLE Shell 3.12.4

You might also like