Lap Python
Lap Python
[11]: print("Noor")
print('757#############43n')
print('Hassan')
Noor
757#############43/n
Hassan
[47]: x=5
y=3
z=x+y
str='The result of sum is:'
print(str,z)
noor='The result of sum is:'
print(noor,z)
print(noor,'sum is:',z)
[39]: x0=4
x1=5.5
z1=x0+x1
z2=x0*x1
print(z1)
print(z2)
noorhassan='The result of sum is:'
print(noorhassan,z1)
9.5
22.0
The result of sum is: 9.5
[51]: if x<y:
print('x is great')
print('any instruction')
print(x)
1
elif x>y: #in this if true then print
print('y is greater')
else: #this will be exicuted if above is not true
print('y is greauuter')
y is greater
[48]: if x<y:
print('x is great')
print('any instruction')
print(x)
else:
print('y is greater')
y is greater
[71]: lst_=[2,5,9,3,'noor','hassan']
print(lst_)
print(lst_[4])
print(lst_[5])
[ 6 8 10 12 14]
a1=np.array([4,5,6,7,8])
2
print(a*a1)
print(a+a1)
[12 20 30 42 56]
[ 7 9 11 13 15]
0
2
4
6
8
0
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
3
9
[94]: lst4=[3,4,5,9]
for x in lst4:
print(x**2) # ** use for power
print(pow(x,3))
9
27
16
64
25
125
81
729
3
5
9
125
125
[113]: 140
4
[ ]: