[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. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

3 / 40

3. A variable name cannot start with a number

4 / 40

4. To insert characters that are illegal in a string, use an escape character

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8.

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

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

9 / 40

9. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

10 / 40

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

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.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

13 / 40

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

14 / 40

14.

 ____________________ 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

15 / 40

15.

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

16 / 40

16.

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.

17 / 40

17.

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

a. 2

b. 3

c. 5

d. Multiple times

18 / 40

18.

What is the data type of print(type(10))

19 / 40

19.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

20 / 40

20. Comments can be used to explain Python code.

21 / 40

21. Python has various versions available

22 / 40

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

23 / 40

23. Comments can’t be used to prevent execution when testing code.

24 / 40

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

25 / 40

25.

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

a. Define

b. DEF

c. def

d. Def

26 / 40

26.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

27 / 40

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

28 / 40

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

29 / 40

29. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

30 / 40

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

31 / 40

31. Python can connect to database systems.

32 / 40

32. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

33 / 40

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

34 / 40

34. Most recent major version of Python is Python 3

35 / 40

35.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

36 / 40

36. Who developed Python Programming Language?

37 / 40

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

38 / 40

38.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

39 / 40

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

40 / 40

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

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.