Q.No.3 - Create a list variable L and ask the user to input 10 integer elements into the list. Write Python code to perform below given operations on the list (Do not use built-in list functions): Create a new list L1 by adding a number 10 to every element in the list L using list comprehension.
Find total no. of positive and negative integers in the list
Count the elements that are divisible by 5
Remove the repetitive items from the list by storing all the unique elements in a new list.
Create a new dictionary by counting the frequency of every element in the list. Store the list elements as keys of dictionary and their frequencies as the values.


Sol.-

n1=int(input("Enter"))
n2=int(input("Enter"))
n3=int(input("Enter"))
n4=int(input("Enter"))
n5=int(input("Enter"))
n6=int(input("Enter"))
n7=int(input("Enter"))
n8=int(input("Enter"))
n9=int(input("Enter"))
n10=int(input("Enter"))
l=[n1,n2,n3,n4,n5,n6,n7,n8,n9,n10]
l1=[]
count_pos=0
count_neg=0
divby5=0 
l1=[num+10 for num in l] 
for i in l:
    if i<0:
        count_neg+=1
    else:
        count_pos+=1
print("List after add 10 to every element",l1)
print("Positive number in list enter by user",count_pos)
print("Negative number in list enter by user",count_neg)
for i in l:
    if i%5==0:
        divby5+=1
print("Number in list divide by 5",divby5)
l2=list(set(l))
print("After remove duplicate value",l2)
dict={}
keyvlue=0
for i in l:
    dict[i]=keyvlue
    keyvlue+=1
print(dict)


Explain : Step 1: We set 10 values which is enter by user. Step 2: After user enter 10 values. Thes values goes to list (l). Step 3: We create a variable to store data - empty list (l1), count_pos , count_neg and divby5 . Step 4: l1 - num+10 use for loop. So when value is 1 it store in l1 as num+10 which is 11. Stpe 5: For loop use for negative and positive value. If i<0 it add in count_neg orthewise it is positive. Step 6: We convert list to set and again to list so the duplicate value remove. Step 7: Create an empty dictionary and keyvlue = 0. Step 8: Use for loop - dict[i]=keyvlue means dict[first value]= store at 0 keyvalue , then next value dict[second value]= store at 1 keyvalue. and further on.

OUTPUT: