[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

3 / 40

3.

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.

4 / 40

4.

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

5 / 40

5. Comments can be used to explain Python code.

6 / 40

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

7 / 40

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

8 / 40

8. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

9 / 40

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

10 / 40

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

11 / 40

11. Python relies on indentation?

12 / 40

12.

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

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

13 / 40

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

14 / 40

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

 

15 / 40

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

16 / 40

16.

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.

17 / 40

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

18 / 40

18. The list’s remove() method only removes the first occurrence of the specified value.

19 / 40

19. Python is an interpreted programming language

20 / 40

20.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

21 / 40

21. Python can be install on both  Linux and  Windows

22 / 40

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

23 / 40

23. Variables that are created outside of a function

24 / 40

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

25 / 40

25.

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

26 / 40

26.

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

27 / 40

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

28 / 40

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

29 / 40

29.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

30 / 40

30.

 What is output of: 35 == 35.0

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

31 / 40

31.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

32 / 40

32.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

33 / 40

33. You can also have an else without the elif

34 / 40

34. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

35 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

36 / 40

36.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

37 / 40

37. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

38 / 40

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

39 / 40

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

40 / 40

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

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.