Python Functions Last Updated : 18 Jan, 2021 Python Functions Please wait while the activity loads. If this activity does not load, try refreshing your browser. Also, this page requires javascript. Please visit using a browser with javascript enabled. If loading fails, click here to try again Question 1What will be the output of the following code : print type(type(int)) type \'int\' type \'type\' Error0Python Functions Discuss itQuestion 1-Explanation: The type() function returns the class of the argument the object belongs to. Thus, type(int) returns which is of the type ‘type’ object.Question 2What is the output of the following code : L = ['a','b','c','d'] print("".join(L)) ErrorNoneabcd[‘a’,’b’,’c’,’d’]Python Functions Discuss itQuestion 2-Explanation: “” depicts a null string and the join function combines the elements of the list into a string.Question 3What is the output of the following segment : chr(ord('A')) ABaErrorPython Functions Discuss itQuestion 3-Explanation: ord() function converts a character into its ASCII notation and chr() converts the ASCII to character.Question 4What is the output of the following program : y = 8 z = lambda x : x * y print (z(6)) 481464None of the abovePython Functions Discuss itQuestion 4-Explanation: lambdas are concise functions and thus, result = 6 * 8Question 5 What is called when a function is defined inside a class? Module Class Another Function Method Python Functions Discuss itQuestion 5-Explanation: Explanation: When a function is defined inside a class then it is called Method. The method is accessible to data that is contained within the class. Question 6Which of the following is the use of id() function in python?Id returns the identity of the objectEvery object doesn’t have a unique idAll of the mentionedNone of the mentionedPython Functions Discuss itQuestion 6-Explanation: Each object in Python has a unique id. The id() function returns the object’s id.Question 7What is the output of the following program : import re sentence = 'horses are fast' regex = re.compile('(?P<animal>\w+) (?P<verb>\w+) (?P<adjective>\w+)') matched = re.search(regex, sentence) print(matched.groupdict()) {‘animal’: ‘horses’, ‘verb’: ‘are’, ‘adjective’: ‘fast’}(‘horses’, ‘are’, ‘fast’)‘horses are fast’‘are’Python Functions Discuss itQuestion 7-Explanation: This function returns a dictionary that contains all the matches.Question 8Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?[3, 4, 5, 20, 5, 25, 1, 3][1, 3, 3, 4, 5, 5, 20, 25][3, 5, 20, 5, 25, 1, 3][1, 3, 4, 5, 20, 5, 25]Python Functions Discuss itQuestion 8-Explanation: pop(i) removes the ith index element from the listQuestion 9time.time() returns ________the current timethe current time in millisecondsthe current time in milliseconds since midnightthe current time in milliseconds since midnight, January 1, 1970the current time in milliseconds since midnight, January 1, 1970 GMT (the Unix time)Python Functions Discuss itQuestion 10Consider the results of a medical experiment that aims to predict whether someone is going to develop myopia based on some physical measurements and heredity. In this case, the input dataset consists of the person’s medical characteristics and the target variable is binary: 1 for those who are likely to develop myopia and 0 for those who aren’t. This can be best classified asRegressionDecision TreeClusteringAssociation RulesISRO CS 2017 Python Functions Discuss itQuestion 10-Explanation: Regression: It is a statistical analysis which is used to establish relation between a response and a predictor variable. It is mainly used in finance related applications. Decision Tree: Decision tree is a computational method which works on descriptive data and records the observations of each object to reach to a result. Clustering: It is a method of grouping more similar objects in a group and the non-similar objects to other groups. Association Rules: It uses if-then reasoning method using the support-confidence technique to give a result. According to the question Decision Tree is the most suitable technique that can be used to get best result of the experiment. 1 There are 10 questions to complete. You have completed questions question Your accuracy is Correct Wrong Partial-Credit You have not finished your quiz. If you leave this page, your progress will be lost. Correct Answer You Selected Not Attempted Final Score on Quiz Attempted Questions Correct Attempted Questions Wrong Questions Not Attempted Total Questions on Quiz Question Details Results Date Score Hint Time allowed minutes seconds Time used Answer Choice(s) Selected Question Text Need more practice! Keep trying! Not bad! Good work! Perfect! Share your thoughts in the comments Add Your Comment Please Login to comment...