Python Questions

0 votes, 0 avg
601

Python Questions

1 / 15

1. What will be the output of the following Python code?

    def func(a, b=5, c=10):

        print('a is', a, 'and b is', b, 'and c is', c)

     

    func(3, 7)

    func(25, c = 24)

    func(c = 50, a = 100)

2 / 15

2. Which of the following counts the number of elements in Numpy array ?

3 / 15

3. What is called when a function is defined inside a class?

4 / 15

4. Which of the following concepts is not a part of Python?

5 / 15

5. The following python program can work with ____ parameters.

def f(x):
    def f1(*args, **kwargs):
           print("JAVA")
           return x(*args, **kwargs)
    return f1

6 / 15

6. Which of the following is true for variable names in Python?

7 / 15

7. The process of pickling in Python includes ____________

8 / 15

8. Which of the following character is used to give single-line comments in Python?

9 / 15

9. What will be the output of the following Python code?

x = 'abcd'
print(list(map(list, x)))

10 / 15

10. What is the order of precedence in python?

11 / 15

11. Which of the following functions converts date to corresponding time in Python?

12 / 15

12. Which of the following is used to define a block of code in Python language?

13 / 15

13. Which of these is the definition for packages in Python?

14 / 15

14. Consider 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 as

15 / 15

15. What will be the output of the following code snippet?

def tester(**kwargs):
   for key, value in kwargs.items():
       print(key, value, end = " ")
tester(Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4)

Your score is

The average score is 37%

0%