[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

3 / 40

3.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

4 / 40

4. Python can connect to database systems.

5 / 40

5. A variable name can only contain alpha-numeric characters and
underscores

6 / 40

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

7 / 40

7. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

8 / 40

8. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

9 / 40

9.

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

10 / 40

10.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

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. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

13 / 40

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

14 / 40

14. To write and execute code in python, we first need to install Python on our system.

15 / 40

15.

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

16 / 40

16.

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

a. 2

b. 3

c. 5

d. Multiple times

17 / 40

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

18 / 40

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

19 / 40

19. Variable names are case-sensitive

20 / 40

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

21 / 40

21. Python relies on indentation?

22 / 40

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

23 / 40

23.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

24 / 40

24.

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

25 / 40

25. Variables that are created outside of a function

26 / 40

26. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

27 / 40

27.

What is the data type of print(type(10))

28 / 40

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

29 / 40

29.

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

30 / 40

30. Comments starts with a #

31 / 40

31.

Which is the correct operator for power(xy)?

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

32 / 40

32. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

33 / 40

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

34 / 40

34.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

35 / 40

35. python has two primitive loop commands:

  • while loops
  • for loops

36 / 40

36.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

37 / 40

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

38 / 40

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

39 / 40

39. The format() method takes unlimited number of arguments

40 / 40

40. Python is a  high-level programming language.

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.