[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6. Python is an interpreted programming language

7 / 40

7.

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

11. What will be the output of the following Python code?

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

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. Python is a  high-level programming language.

14 / 40

14.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

15 / 40

15.

 Select the correct example of complex datatype in Python

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

16 / 40

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

17 / 40

17. python has two primitive loop commands:

  • while loops
  • for loops

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22. Python has a set of built-in methods that you can use on lists/arrays

23 / 40

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

24 / 40

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

a. 5

b. 3

c. 6

d. 7

25 / 40

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

26 / 40

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

27 / 40

27. Comments can be used to explain Python code.

28 / 40

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

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. The len() method to return the length of an array

31 / 40

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

32 / 40

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

33 / 40

33. python file can also run on command line

34 / 40

34. You can also have an else without the elif

35 / 40

35. Comments starts with a #

36 / 40

36.

 ____________________ 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

37 / 40

37. Python relies on indentation?

38 / 40

38.

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

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

39 / 40

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

40 / 40

40. Is there any comments in  following codes

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

 

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.