[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

2 / 40

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

3 / 40

3. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

4 / 40

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

5 / 40

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

6 / 40

6. Who developed Python Programming Language?

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

11.

 What is output of: 35 == 35.0

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

12 / 40

12.

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

a. 2

b. 3

c. 5

d. Multiple times

13 / 40

13. Python allows you to extract the values into variables.

14 / 40

14.

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

15 / 40

15.

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

16 / 40

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

17 / 40

17. With the break statement we can stop the loop even if the while condition is true

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

27 / 40

27.

Which is the correct operator for power(xy)?

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

28 / 40

28.

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

29 / 40

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

30 / 40

30.

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

31 / 40

31. Most recent major version of Python is Python 3

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. The format() method takes the passed arguments

37 / 40

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

38 / 40

38. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

39 / 40

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

40 / 40

40.

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

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

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.