[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

2 / 40

2.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

3 / 40

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

4 / 40

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

5 / 40

5. Comments can be used to explain Python code.

6 / 40

6.

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

a. True

b. False

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

 What is output of: 35 == 35.0

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

15 / 40

15. Python can be install on both  Linux and  Windows

16 / 40

16.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

17 / 40

17.

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

18 / 40

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

19 / 40

19. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

20 / 40

20. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

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

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

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

a. 5

b. 3

c. 6

d. 7

35 / 40

35. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

36 / 40

36.

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

37 / 40

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

38 / 40

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

39 / 40

39. Extension of all Python  Programme are .py

40 / 40

40. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None 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.