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

2 / 40

2.

Which is the correct operator for power(xy)?

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

3 / 40

3.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

4 / 40

4. We can combine strings and numbers by using the format() method

5 / 40

5. Most recent major version of Python is Python 3

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

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

a. 2

b. 3

c. 5

d. Multiple times

11 / 40

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

12 / 40

12. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

13 / 40

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

14 / 40

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

15 / 40

15. Pascal Case
Each word starts with a capital letter:

16 / 40

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

17 / 40

17. The format() method takes unlimited number of arguments

18 / 40

18.

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.

19 / 40

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

20 / 40

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

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. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

23 / 40

23. Camel Case
Each word, except the first, starts with a capital letter:

24 / 40

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

25 / 40

25.

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

26 / 40

26.

What is the value of the expression 100 / 25?

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

27 / 40

27. Python will give you an error if you skip the indentation

28 / 40

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

29 / 40

29.

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

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

30 / 40

30.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

31 / 40

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

32 / 40

32.

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

33 / 40

33. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

34 / 40

34. Python can connect to database systems.

35 / 40

35.

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

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

36 / 40

36. The format() method takes the passed arguments

37 / 40

37. + operator is used  to get output of multiple variables

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. Python  was created by Guido van Rossum, and released in 1999.

40 / 40

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

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.