[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

3 / 40

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

4 / 40

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

a. 5

b. 3

c. 6

d. 7

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. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

7 / 40

7.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

8 / 40

8.

How to copy one list to another in python?

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

9 / 40

9.

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

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

10 / 40

10.

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

a. Define

b. DEF

c. def

d. Def

11 / 40

11.

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

12 / 40

12.

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

13 / 40

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

14 / 40

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

15 / 40

15. Python can be used on a server to create web applications?

16 / 40

16. You can also have an else without the elif

17 / 40

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

18 / 40

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

19 / 40

19. Which of the following is the correct extension of the Python file?

20 / 40

20.

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

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

21 / 40

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

22 / 40

22.

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.

23 / 40

23.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

24 / 40

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

25 / 40

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

26 / 40

26. Python has various versions available

27 / 40

27.

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

28 / 40

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

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. + operator is used  to get output of multiple variables

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

38 / 40

38.

Which function overloads the >> operator?

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

39 / 40

39. Who developed Python Programming Language?

40 / 40

40.

Which is the correct operator for power(xy)?

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

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.