[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

2 / 40

2.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

3 / 40

3. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

4 / 40

4. Official site of python is www.python.org

5 / 40

5.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

6 / 40

6. You can use the append() method to add an element to an array

7 / 40

7.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

8 / 40

8.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

9 / 40

9. Extension of all Python  Programme are .py

10 / 40

10. Python allows you to extract the values into variables.

11 / 40

11. Python can be install on both  Linux and  Windows

12 / 40

12. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

13 / 40

13. Operators are used to perform operations on variables and values

14 / 40

14. Arithmetic operators are used with numeric values to perform common mathematical operations

15 / 40

15. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

16 / 40

16. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

17 / 40

17. Pip is  not a powerful package management system for Python software packages

18 / 40

18.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

19 / 40

19. The len() method to return the length of an array

20 / 40

20. Python has various versions available

21 / 40

21. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

22 / 40

22.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

23 / 40

23. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

24 / 40

24. Camel Case
Each word, except the first, starts with a capital letter:

25 / 40

25. Python has a set of built-in methods that you can use on lists/arrays

26 / 40

26.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

27 / 40

27. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

28 / 40

28.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

29 / 40

29. The else keyword catches anything which isn’t caught by the preceding conditions.

30 / 40

30. Python will give you an error if you skip the indentation

31 / 40

31. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

32 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

33 / 40

33.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

34 / 40

34. We can combine strings and numbers by using the format() method

35 / 40

35. With the break statement we can stop the loop even if the while condition is true

36 / 40

36. An array is a special variable, which can hold more than one value at a time

37 / 40

37.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

38 / 40

38. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

39 / 40

39.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

40 / 40

40. An array can hold many values under a single name

Exit



[hurrytimer id=”2250″]
[wooct_product]

Wrong shortcode initialized


You must log in to see your results.



Wrong shortcode initialized


There are no questions atteched yet.





[ays_quiz_leaderboard id=”Your_Quiz_ID” from=”Y-m-d H:i:sa” to=”Y-m-d H:i:s”]

Category:


Wrong shortcode initialized


[WATU 1]

You must log in to see your results.