[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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.

2 / 40

2.

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6.

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

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. Most recent major version of Python is Python 3

9 / 40

9. python file can also run on command line

10 / 40

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

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 can use the append() method to add an element to an array

13 / 40

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

a. 5

b. 3

c. 6

d. 7

14 / 40

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

15 / 40

15. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

16 / 40

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

17 / 40

17.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

18 / 40

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

19 / 40

19. The format() method takes the passed arguments

20 / 40

20. Comments can be used to make the code more readable.

21 / 40

21.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

22 / 40

22. Python is a  high-level programming language.

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

27 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

28 / 40

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

29 / 40

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

30 / 40

30. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34. With the break statement we can stop the loop before it has looped through all the items

35 / 40

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

36 / 40

36. Is there any comments in  following codes

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

 

37 / 40

37.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

38 / 40

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

39 / 40

39. Python has various versions available

40 / 40

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

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.