[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

2.

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

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

3 / 40

3. Who developed Python Programming Language?

4 / 40

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

5 / 40

5. Variables that are created outside of a function

6 / 40

6. Python can be used to handle big data and perform complex mathematics.

7 / 40

7.

 ____________________ 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

8 / 40

8. Most recent major version of Python is Python 3

9 / 40

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

10 / 40

10. A variable name cannot start with a number

11 / 40

11. Python relies on indentation?

12 / 40

12.

What is the value of the expression 100 / 25?

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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

21 / 40

21.

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

a. Define

b. DEF

c. def

d. Def

22 / 40

22.

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

23 / 40

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

24 / 40

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

25 / 40

25.

 What is output of: 35 == 35.0

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

26 / 40

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

27 / 40

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

28 / 40

28. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

29 / 40

29. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

30 / 40

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

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. Indentation refers to the spaces at the beginning of a code line.

33 / 40

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

34 / 40

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

35 / 40

35.

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

36 / 40

36.

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.

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

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.