[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

2 / 40

2.

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

a. 2

b. 3

c. 5

d. Multiple times

3 / 40

3. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

4 / 40

4.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

5 / 40

5. During Installation Make sure to select both the checkboxes at the bottom .

6 / 40

6. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

7 / 40

7.

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.

8 / 40

8. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12. 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

13 / 40

13. Python  was created by Guido van Rossum, and released in 1999.

14 / 40

14. The length of an array is always one more than the highest array index.

15 / 40

15. Indentation refers to the spaces at the beginning of a code line.

16 / 40

16. 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

17 / 40

17. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

18 / 40

18. The format() method takes the passed arguments

19 / 40

19. Most recent major version of Python is Python 3

20 / 40

20. Comments can’t be used to prevent execution when testing code.

21 / 40

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

22 / 40

22. Variable names are case-sensitive

23 / 40

23.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

24 / 40

24.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

25 / 40

25. Python can be treated in a procedural way, an object-oriented way or a functional way.

26 / 40

26. You can return a range of characters by using the slice syntax

27 / 40

27. Who developed Python Programming Language?

28 / 40

28. + operator is used  to get output of multiple variables

29 / 40

29.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

30 / 40

30. Bitwise operators are used to compare (binary) numbers

31 / 40

31. Python can be used to handle big data and perform complex mathematics.

32 / 40

32.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

33 / 40

33.

Which is the correct operator for power(xy)?

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

34 / 40

34.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

35 / 40

35. Strings in python are surrounded by either single quotation marks, or double quotation marks

36 / 40

36. With the for loop we can execute a set of statements

37 / 40

37. Python is a  high-level programming language.

38 / 40

38.

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

39 / 40

39. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

40 / 40

40. You can use the pop() method to remove an element from the array

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.