[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. print() function is often used to output variables.

3 / 40

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

4 / 40

4. Most recent major version of Python is Python 3

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

9 / 40

9. Arrays are used to store multiple values in one single variable.

10 / 40

10. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

11 / 40

11. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

12 / 40

12.

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

13 / 40

13. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

14 / 40

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

a. 5

b. 3

c. 6

d. 7

15 / 40

15. You can have if statements inside if statements, this is called nested if statements.

16 / 40

16.

 Select the correct example of complex datatype in Python

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

17 / 40

17. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

18 / 40

18.

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

a. 2

b. 3

c. 5

d. Multiple times

19 / 40

19. To insert characters that are illegal in a string, use an escape character

20 / 40

20.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

21 / 40

21. You can also have multiple else statements on the same line:

22 / 40

22. python file can also run on command line

23 / 40

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

24 / 40

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

25 / 40

25. Which of the following is the correct extension of the Python file?

26 / 40

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

27 / 40

27. Snake Case
Each word is separated by an underscore character:

28 / 40

28. You can also use the remove() method to remove an element from the array

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32. 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))

33 / 40

33.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

34 / 40

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

35 / 40

35.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

36 / 40

36.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

37 / 40

37. Python can connect to database systems.

38 / 40

38. python has two primitive loop commands:

  • while loops
  • for loops

39 / 40

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

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.