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

Python 3.11.9 Basic Calculations Guide

vjj
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)
7 views4 pages

Python 3.11.9 Basic Calculations Guide

vjj
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

Python 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.

1938 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("MAKWANA MIHIR 24BCH199")
MAKWANA MIHIR 24BCH199

>>> A=6
>>> B=4
1)
>>> A+B
10

2)
>>> A-B
2

3)
>>> A*B
24

4)
>>> A/B
1.5

5)
>>> A**B
1296
>>> A//B
1
>>> a=7
>>> b=5
>>> addition=a+b
>>> addition
12
>>> subtraction=a-b
>>> subtraction
2
>>> multiplication=a*b
>>> multiplication
35
>>> division=a/b
>>> division
1.4

6)
>>> hours=int(input("enter the hours:" ))
enter the hours:7
>>> minutes=hours*60
>>> minutes
420

7)
>>> minutes=int(input("enter the minutes:"))
enter the minutes:120
>>> hours=minutes/60
>>> hours
2.0

8)
>>> dollar=int(input("enter the dollar:"))
enter the dollar:10
>>> rupees=dollar*85
>>> rupees
850

9)
>>> rupees=int(input("enter the rupees: "))
enter the rupees: 510
>>> dollar=rupees/85
>>> dollar
6.0

10)
>>> dollar=int(input("enter the dollar: "))
enter the dollar: 100
>>> pound=dollar*0.82
>>> pound
82.0

11)
>>> kgs=int(input("enter the kgs: "))
enter the kgs: 7
>>> grams=kgs*1000
>>> grams
7000

12)
>>> grams=int(input("enter the grams: "))
enter the grams: 3000
>>> kgs=grams/1000
>>> kgs
3.0

13)
>>> byte=int(input("enter the byte: "))
enter the byte: 100000
>>> KB=byte/1000
>>> KB
100.0
>>> MB=byte/1000000
>>> MB
0.1
>>> GB=byte/1000000000
>>> GB
0.0001

14)
>>> celcius=int(input("enter the calcius: "))
enter the calcius: 79
>>> fahrenheit=(9/5*celcius)+32
>>> fahrenheit
174.20000000000002

15)
>>> fahrenheit=int(input("enter the fahrenheit: "))
enter the fahrenheit: 264
>>> celcius=5/9*(fahrenheit-32)
>>> celcius
128.8888888888888

16)
>>> p=float(input("enter the principal: "))
enter the principal: 2000
>>> r=float(input("enter the rate: "))
enter the rate: 2
>>> n=float(input("enter the time in years: "))
enter the time in years: 1
>>> interest=(p*r*n)/100
>>> interest
40.0

17)
>>> side=int(input("enter side: "))
enter side: 4
>>> area=side*side
>>> area
16
>>> perimeter=4*side
>>> perimeter
16

18)
>>> l=int(input("enter length: "))
enter length: 5
>>> b=int(input("breadth: "))
breadth: 8
>>> area=l*b
>>> area
40
>>> perimeter=2*(l+b)
>>> perimeter
26

19)
>>> R=int(input("enter Radius: "))
enter Radius: 8
>>> area=22/7*R*R
>>> area
201.14285714285714

20)
>>> b=int(input("enter base: "))
enter base: 2
>>> h=int(input("enter height: "))
enter height: 5
>>> area=(b*h)/2
>>> area
5.0

21)
>>> GrossSalay=int(input("enter gross Salay: "))
enter gross Salay: 30000
>>> allowance=GrossSalay*0.10
>>> deduction=GrossSalay*0.03
>>> NatSalay=GrossSalay+allowance-deduction
>>> NatSalay
32100.0
22)
>>> GrossSalay=int(input("enter gross Salay: "))
enter gross Salay: 50000
>>> discount=GrossSalay*0.10
>>> NatSalay=GrossSalay-discount
>>> NatSalay
45000.0

23)
>>> subjects1=int(input("enter subjects1 marks:"))
enter subjects1 marks:89
>>> subjects2=int(input("enter subjects2 marks:"))
enter subjects2 marks:70
>>> subjects3=int(input("enter subjects3 marks:"))
enter subjects3 marks:93
>>> total= subjects1+subjects2+subjects3
>>> total
252
>>> average=total/3
>>> average
84.0

24)
>>> a=input("enter first value: ")
enter first value: 5
>>> b=input("enter second value: ")
enter second value: 8
>>> temp=a
>>> a=b
>>> b=temp
>>> a
'8'
>>> b
'5'

You might also like