# sunnysingh-appstone/untitled3

2 years ago
In [ ]:
``````a=int(input("Enter a no"))
num=a
rem=0
sum=0
while(num>0):
rem=num%10
rem=rem*rem*rem
num=int(num/10)
sum=sum+rem
if(sum==a):
print("armstrong no")
else:
print("not")``````
In [ ]:
``print(4*"*")``
In [3]:
``````a=int(input("Enter a number"))
i=1
fact=1
while(i<=a):
fact=fact*i
i=i+1
print("Factorial of the given no is {one}".format(one=fact))``````
```Enter a number3 Factorial of the given no is 6 ```
In [8]:
``print("{s} something  {v}".format(s=5,v=10))``
```5 something 10 ```
In [9]:
``range(5)``
Out[9]:
``range(0, 5)``
In [10]:
``````import numpy as np

``````
In [28]:
``np.eye(7,M=7,k=-6,dtype=int)``
Out[28]:
``````array([[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[1, 0, 0, 0, 0, 0, 0]])``````
In [30]:
``np.ones(4)``
Out[30]:
``array([1., 1., 1., 1.])``
In [31]:
``np.zeros(4)``
Out[31]:
``array([0., 0., 0., 0.])``
In [35]:
``np.arange(1,5)``
Out[35]:
``array([1, 2, 3, 4])``
In [33]:
``range(5)``
Out[33]:
``range(0, 5)``
In [36]:
``````for i in range(10):
print(i)
``````
```0 1 2 3 4 5 6 7 8 9 ```
In [37]:
``````for i in np.arange(10):
print(i)
``````
```0 1 2 3 4 5 6 7 8 9 ```
In [38]:
``import pandas as pd``
In [ ]:
`` ``
In [50]:
``````a=np.arange(25)
a
``````
Out[50]:
``````array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24])``````
In [49]:
``````a=np.reshape(a,newshape=[5,5])
a
``````
Out[49]:
``````array([[ 0,  1,  2,  3,  4],
[ 5,  6,  7,  8,  9],
[10, 11, 12, 13, 14],
[15, 16, 17, 18, 19],
[20, 21, 22, 23, 24]])``````
In [57]:
``````import jovian

``````
In [ ]:
``jovian.commit()``
```[jovian] Saving notebook.. ```
In [ ]:
`` ``