Assignment 2 - Date 16 11 23
Assignment 2 - Date 16 11 23
ASSIGNMENT - 2
----------------------------
1. NAME : SUPRIYA DHARA
2. STREAM : MCA
3. SEM : 1
4. SESSION : 2023-2025
5. ROLL NO : 4
�. GROUP : X
Q1 : USE OF INTEGER
a = 10
b = 24
c = 16
d = 30
e = 2
f = 3
g = 5
w = a+b-c
x = d**c
y = f % g
print(w)
print(x)
print(y)
18
430467210000000000000000
3
i = 3.5
j = 1.2
print(i%j)
1.1
Q3 : USE OF COMPLEX
1 of 5 22-11-2023, 21:54
ASSIGNMENT-1 - Colaboratory https://colab.research.google.com/drive/1BQ3e4r2mKqj2Jq2dvMfb_6...
a = 1+2j
print(type(a))
b = 3 * a
print(b)
c = a*b
print(c)
Q4: USE OF BOOLEAN x = 10, y = 20 �nd out the result of x>y, x<y, x<=y, x>=y
x = 10
y = 20
print(x>y)
print(x>=y)
print(x<=y)
print(x<y)
False
False
True
True
a = 5
b = 5.8
c = 3+2j
print(type(a))
print(type(b))
print(type(c))
<class 'int'>
<class 'float'>
<class 'complex'>
2 of 5 22-11-2023, 21:54
ASSIGNMENT-1 - Colaboratory https://colab.research.google.com/drive/1BQ3e4r2mKqj2Jq2dvMfb_6...
<class 'complex'>
a = 3.14
b = '485'
c = '768'
print(int(c))
print(type(int(c)))
d = '1011'
print(int('1011',2))
print(int('341',8))
print(int('21',16))
768
<class 'int'>
11
225
33
a = 35
b ='4.85'
c = '7.68'
print(float(a))
print(float(b))
print(float(c))
35.0
4.85
7.68
a = 35
3 of 5 22-11-2023, 21:54
ASSIGNMENT-1 - Colaboratory https://colab.research.google.com/drive/1BQ3e4r2mKqj2Jq2dvMfb_6...
b = 4.2
print(bool(a))
print(bool(b))
True
True
a = 35
x = complex(4.85, 1.1)
y = complex(4.68,2.1)
print(a)
print(x)
print(y)
35
(4.85+1.1j)
(4.68+2.1j)
if(a==b):
print("Numbers are Equal")
else:
print("Numbers are Not Equal")
Enter 1st Number : 10
Enter 2nd Number : 25
Numbers are Not Equal
4 of 5 22-11-2023, 21:54
ASSIGNMENT-1 - Colaboratory https://colab.research.google.com/drive/1BQ3e4r2mKqj2Jq2dvMfb_6...
if(a+b)>5:
print("The sum of number is Greater than 5")
elif(a+b)==5:
print("The sum of number is Equal to 5")
else:
print("The sum of number is less than 5")
5 of 5 22-11-2023, 21:54