[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

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

2 / 40

2. Extension of all Python  Programme are .py

3 / 40

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

4 / 40

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

5 / 40

5. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

6 / 40

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

7 / 40

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

8 / 40

8. Python can connect to database systems.

9 / 40

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

10 / 40

10. Comparison operators are not  used to compare two values

11 / 40

11.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

12 / 40

12.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

13 / 40

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

14 / 40

14.

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

a. True

b. False

15 / 40

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

16 / 40

16. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

17 / 40

17.

How to copy one list to another in python?

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

18 / 40

18.

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

19 / 40

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

20 / 40

20. Python has various versions available

21 / 40

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

22 / 40

22.

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.

23 / 40

23. Official site of python is www.python.org

24 / 40

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

25 / 40

25.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

26 / 40

26. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

27 / 40

27.

 ____________________ 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

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35. Strings in python are surrounded by either single quotation marks, or double quotation marks

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. Variable names are case-sensitive

40 / 40

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

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.