[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

2 / 40

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

3 / 40

3. python file can also run on command line

4 / 40

4. 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()

 

5 / 40

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

6 / 40

6. Comments can be used to explain Python code.

7 / 40

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

8 / 40

8. Python has various versions available

9 / 40

9.

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.

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13.

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

14 / 40

14.

What is the data type of print(type(0xFF))

15 / 40

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

16 / 40

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

17 / 40

17.

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.

18 / 40

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

19 / 40

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

20 / 40

20. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

21 / 40

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

22 / 40

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

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

25 / 40

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

26 / 40

26. The for loop does not require an indexing variable to set beforehand

27 / 40

27.

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

28 / 40

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

29 / 40

29. A variable name must start with a letter or the underscore character

30 / 40

30. Python can be used on a server to create web applications?

31 / 40

31.

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.

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35.

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

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

36 / 40

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

37 / 40

37. Comparison operators are not  used to compare two values

38 / 40

38.

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

a. 2

b. 3

c. 5

d. Multiple times

39 / 40

39. Python is a  high-level programming language.

40 / 40

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

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.