[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

How to copy one list to another in python?

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

3 / 40

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

4 / 40

4. Who developed Python Programming Language?

5 / 40

5. The format() method takes the passed arguments

6 / 40

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

7 / 40

7. Comments can be used to explain Python code.

8 / 40

8. 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”

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12. Variable names are case-sensitive

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

15 / 40

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

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. With the break statement we can stop the loop before it has looped through all the items

18 / 40

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

19 / 40

19. A variable name cannot start with a number

20 / 40

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

21 / 40

21.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

22 / 40

22.

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

23 / 40

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

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

26 / 40

26. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

27 / 40

27. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

28 / 40

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

29 / 40

29.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

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. Extension of all Python  Programme are .py

32 / 40

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

33 / 40

33.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

34 / 40

34.

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

a. [ ]

b. { }

c. ( )

d. None of the above

35 / 40

35.

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

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

36 / 40

36. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

37 / 40

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

38 / 40

38.

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

a. Define

b. DEF

c. def

d. Def

39 / 40

39.

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

40 / 40

40. Python can connect to database systems.

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.