MCQs > IT & Programming > Python > Output of the following Python code. def req(str): p=2 str = str.split() str2 = [] for i in str: if i not in str2: str2.append(i) for i in range(0, len(str2)): p=str.count(str2[i])+p print(p) def main(): str =str ='apple mango apple orange orange apple guava mango mango' req(str) if __name__=='__main__': main()'>

Python MCQs

Find the correct output of the following Python code.

def req(str):

p=2

str = str.split()

str2 = []

for i in str:

    if i not in str2:

        str2.append(i)

         

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

    p=str.count(str2[i])+p

print(p)

     

def main():

str =str ='apple mango apple orange orange apple guava mango mango' req(str) if __name__=="__main__": main() ">

Answer

Correct Answer:

11 

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it