Thanks to visit codestin.com
Credit goes to www.scribd.com

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

Maths Codeing

The document contains Python code snippets for calculating the perimeter and area of various geometric shapes including squares, rectangles, parallelograms, and triangles. It also includes code for converting dollars to rupees, converting weight from kilograms to grams, and greeting the user. Additionally, there is a section that determines the greatest of three input numbers.

Uploaded by

aswin.fire19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Maths Codeing

The document contains Python code snippets for calculating the perimeter and area of various geometric shapes including squares, rectangles, parallelograms, and triangles. It also includes code for converting dollars to rupees, converting weight from kilograms to grams, and greeting the user. Additionally, there is a section that determines the greatest of three input numbers.

Uploaded by

aswin.fire19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

square:

square = int(input( 'what is the side of the square ?' ))


perimeter = (square * 4 )
print (perimeter)

square = int(input( 'what is the side of the square ?' ))


area = (square * square )
print ( area )

rectangle:

length = int(input( 'what is the length of the rectangle ?' ))


breadth = int(input( 'what is the breadth of the rectangle ?' ))
perimeter= (2 * (length + breadth))
print(perimeter)

length = int(input( 'what is the length of the rectangle ?' ))


breadth = int(input( 'what is the breadth of the rectangle ?' ))
area = (length * breadth)
print(area)

parallelogram:

length = int(input( 'what is the length of the parallelogram ?' ))


breadth = int(input( 'what is the breadth of the parallelogram ?' ))

perimeter= (2 * (length + breadth))


print(perimeter)

base = int(input( 'what is the base of the parallelogram ?' ))


height = int(input( 'what is the height of the parallelogram ?' ))
area = (base * height)
print(area)

triangle:

first_side = int(input( 'what is the first_side of the triangle ?' ))


sceond_side = int(input( 'what is the sceond_side of the triangle ?' ))
third_side = int(input( 'what is the third_side of the triangle ?' ))
perimeter = ( first_side + sceond_side + third_side )
print(perimeter)

base = int(input('what is the base of the triangle ? '))


height = int(input('what is the height of the triangle ? '))
area= ( 1/2 * base * height )
print(area)

doller =input(' how many dollers you have to convert into (ruppes) ? ')
ruppes = int(doller) * 74.35
print ( ruppes )

NAME = input ( 'what is your name ?')


COLOUR = input ( 'what is your favourite colour ?' )
EASY =( NAME + "likes " + COLOUR )
print(EASY)

weight = float(input('who many kg you have to conver into grams ?' ))


grams = (weight * 1000)
print(grams)

name = input('what is your name ?')


hi = ('Hello '+name)
print(hi )

print('''I am python your assitante


Can I help you with your maths problem.
you can enter your values ane get the result.''' )

a =int(input('what is your number?'))


b = int(input('what is your second number?'))
c = int(input('what is your third number?'))
if a > b:
if a > c:
print( a , ' is the greatest number' )
else:
print(c,' is the greatest')
elif(b > c):
print(b,' is the greatest')
else:
print(c, 'is the greatest')

You might also like