WAP to print to check option is correct that is use in OMR sheet

 Write a program  to print to check option is correct that is use in OMR sheet

""""WAP to print to check option is correct 

#if your option of that corresponding question is not same so it will pass and it will not count


"""



# To do this program you must have to understand that what user is trying to ask the user to get the output. 

Then we will break in parts such

1) if the answer key or we can say some values of the first list are given and we have to compare the values of second list . 

2) to do this first we will take input from the user and assign the Correctanswer and input in the form of list. 

3) And take input in the another list and assign Youranswer. 

4) Now we have to check first element of the first to the second list. To do this we will use loop to compare the values. 

5) Take variable count and it's value is equal to 0.

6) If first index value of first list compare to second list of its first index value. This loop only compare same index to same index value of the another list. 

7) if any value of the first list is equal to the of that index value then it will count +1.

And use print() function to print how many element is same to another list. 

Correctanswer=eval(input("Enter a correct option in the list using quotes :"))                                                               #list=["a","b","c","d","a","b",'c']

Youranswer=eval(input("Enter your option to check how many your answer is correct:"))                                                                                        #lst=["b","c","c","a","a","b","c"]

count=0                                                                            #here count variable use to count how many your option is correct

for i in range(0,len(Correctanswer)):

if Youranswer[i]==Correctanswer[i]:

            

count=count+1

print("Your marks is:",count)


OUTPUT:




Correctanswer=eval(input("Enter a correct option in the list using quotes :")) #list=["a","b","c","d","a","b",'c'] Youranswer=eval(input("Enter your option to check how many your answer is correct:")) #lst=["b","c","c","a","a","b","c"] count=0 #here count variable use to count how many your option is correct for i in range(0,len(Correctanswer)): if Youranswer[i]==Correctanswer[i]: count=count+1 print("Your marks is:",count)
WAP to print to check option is correct that is use in OMR sheet WAP to print to check option is correct that is use in OMR sheet Reviewed by Shubham Prajapati on March 19, 2021 Rating: 5

No comments:

If you have any doubt so you can comment me then i will 100% help you ,Through comment Chat

Powered by Blogger.