[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. print() function is often used to output variables.

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5. Most recent major version of Python is Python 3

6 / 40

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

7 / 40

7. You can have if statements inside if statements, this is called nested if statements.

8 / 40

8. The len() method to return the length of an array

9 / 40

9.

Which is the correct operator for power(xy)?

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

10 / 40

10.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

11 / 40

11. The length of an array is always one more than the highest array index.

12 / 40

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

13 / 40

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

14 / 40

14.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

15 / 40

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

16 / 40

16.

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

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

17 / 40

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

18 / 40

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

19 / 40

19. Python can connect to database systems.

20 / 40

20. Comments can be used to explain Python code.

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24.

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

25 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

26 / 40

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

27 / 40

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

28 / 40

28.

Which function overloads the >> operator?

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

29 / 40

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

30 / 40

30.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

31 / 40

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

32 / 40

32. Python can be used to handle big data and perform complex mathematics.

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36.

 What is output of: 35 == 35.0

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

37 / 40

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

38 / 40

38. Variables that are created outside of a function

39 / 40

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

40 / 40

40.

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

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.