import random

def q1(s1):
    c=list(s1)
    return(c)
    
s=input()
a1=q1(s)
print(a1)

def q2(s2):
    ans=""
    for i in s2:
        ans=ans+i
    return ans
    
print(q2(a1))

def q3(s3):
    l1=[]
    for i in range(0,s3):
         n=random.randint(1,s3)
         l1.append(n)
    return(l1)

i3=input("enter n:")
print(q3(int(i3)))


def q4(s4):
    s4.sort(reverse=True)
    return s4;
    
i4=int(input("enter the number of elements to be in list:"))
l2=[]
for i in range(0,i4):
    temp=int(input())
    l2.append(temp)

print(q4(l2))


def q5(a):
    ele_count={}
    l=[]
    for ele in a:
        if ele in ele_count:
            ele_count[ele]+=1
        else:
            ele_count[ele]=1
    l.append(ele_count)
    return l
    
n=int(input("enter no of elements:"))
a=[]
for i in range(0,n):
    temp1=int(input())
    a.append(temp1)

print(q5(a))

def q6(a):
    s6=set()
    s6.update(a)
    return s6
    
    
n=int(input("enter no of elements:"))
a=[]
for i in range(0,n):
    temp1=int(input())
    a.append(temp1)

print(q6(a))

def q7(a):
    s2=set()
    for ele in a:
        if ele in s2:
           return ele
           break
        else:
            s2.add(ele)
    
n=int(input("enter no of elements:"))
a=[]
for i in range(0,n):
    temp1=int(input())
    a.append(temp1)

print(q7(a))

def q8(n):
    for i in range(0,n+1):
        d1[i]=[i*i,(i*i*i)]
    return d1;

i8=input("enter n:")
print(q8(i8))

def q9(l1,l2):
    a = tuple(zip(l1,l2))
    return a

n=int(input())
l1=list()
l2=list()
for i in range(0,n):
    temp=int(input())
    l1.append(temp)
for i in range(0,n):
    temp1=input()
    l2.append(temp1)
        
print(q9(l1,l2))


def q10(n):
    l1=list();
    for i in range(0,n+1):
        temp=i*i;
        l1.append(temp)
    return l1

i10=int(input("enter n:"))    
print(q10(i10))

def q11(n):
    d1=dict()
    for i in range(0,n+1):
        d1[i]=i*i
    return d1;

i11=int(input("enter n:"))
print(q11(i11))















    

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: