Jovian
⭐️
Sign In
In [ ]:
a=2
b=2
print(id(a))
print(id(b))
In [ ]:
a=[1,2,3,4]
a.append(5)
In [ ]:
a
In [ ]:
a


In [ ]:
a[0]
In [ ]:
b=3
a[0]=4
In [ ]:
a
In [ ]:
a=input("Enter a number")
b=input("Enter another number")
c=input("Enter another number")
d=input("Enter another number")
e=input("Enter another number")
arr=[]
arr.append(a)
arr.append(b)
arr.append(c)
arr.append(d)
arr.append(e)
arr
In [ ]:
arr=[1,2,3,4,"something"]
In [ ]:
arr
In [ ]:
arr.pop()
In [ ]:
arr
In [ ]:
tup=(1,2,3)
In [ ]:
tup
In [ ]:
type(tup)
In [ ]:
tup=(1,2,3,4,"something")
In [ ]:
tup
In [ ]:
tup[2]=45
In [ ]:
tup=(1,2,3,4,[2,4,5])
In [ ]:
tup
In [ ]:
tup[4].append(3)
In [ ]:
tup
In [ ]:
tup
In [ ]:
type(tup)
In [ ]:
tup=list(tup)
In [ ]:
type(tup)
In [ ]:
tup=tuple(tup)
In [ ]:
tup
In [ ]:
type(tup)
In [ ]:
se={1,2,3,4}
In [ ]:
se
In [ ]:
di={"one":1,
   "two":2,
    "three":3}
In [ ]:
di
In [ ]:
di["one"]
In [ ]:
di["four"]=4
In [ ]:
di
In [ ]:
di.values()
In [ ]:
di.keys()
In [ ]:
range(1,8,4)
In [ ]:
for i in range(1,8,3):
    print(i)
In [ ]:
for i in [1,2,3,4]:
    print(i)
In [ ]:
for i in 45:
    print(i)
In [ ]:
a=[]
for i in range(1,6):
    b=int(input("Enter number:"))
    a.append(b)
print(a)
In [ ]:
name=input("Enter A string")
count=0
for i in name:
    if i in "AEIOUaeiou":
        count=count+1
        print(i)
print(count)
In [ ]:
if i in "something":
    print(i)
    print(type(i))

In [ ]:
i

In [ ]:
while True:
    print("something")
In [16]:
def add(a,b):
    sum=a+b
    return sum
call=add(7,4)
print(call)

    
11
In [17]:
for i in (1,2,3):
    print(i)
1 2 3
In [20]:
a={1,22,3}
print(type(a))
<class 'set'>
In [23]:
for i in range(1,7):
    print(i)
else:
    print("inside else")
1 2 3 4 5 6 inside else
In [27]:
num=int(input("Enter a number"))
count=0
for i in range(1,num+1):
    if(num%i == 0):
        count=count+1
if(count==2):
    print("Prime Number")
else:
    print("Not Prime")
Enter a number5 Prime Number
In [28]:
print("S"*2)
SS
In [33]:
for i in range(1,6):
    print("*"*i)
for i in range(4,0,-1):
    print("*"*i)
* ** *** **** ***** **** *** ** *
In [36]:
no=12
no=int(no/10)
print(no)
1
In [37]:
s=int(input("enter a number"))
m=s
rev=0
while m>0:
    rem=m%10
    rev=rev*10+rem
    m=m//10
if(rev==s):
    print("pallindrome")
else:
    print("not pallindrome")
enter a number121 pallindrome
In [38]:
import jovian
In [ ]:
jovian.commit()
[jovian] Saving notebook..
In [ ]: