[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

2 / 40

2.

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

3 / 40

3. Comparison operators are not  used to compare two values

4 / 40

4.

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

5 / 40

5.

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

6 / 40

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

7 / 40

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

a. 5

b. 3

c. 6

d. 7

8 / 40

8.

 ____________________ 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

9 / 40

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

10 / 40

10.

What will be the output of below Python code?

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

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

11 / 40

11. python file can also run on command line

12 / 40

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

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.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

15 / 40

15.

Which is the correct operator for power(xy)?

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

16 / 40

16. python has two primitive loop commands:

  • while loops
  • for loops

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

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.

22 / 40

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

23 / 40

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

24 / 40

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

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. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

27 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

28 / 40

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

29 / 40

29. Python is an interpreted programming language

30 / 40

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

31 / 40

31.

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

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

32 / 40

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

33 / 40

33.

 What is output of: 35 == 35.0

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

34 / 40

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

35 / 40

35.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

36 / 40

36. Extension of all Python  Programme are .py

37 / 40

37. You can also have multiple else statements on the same line:

38 / 40

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

39 / 40

39. The format() method takes the passed arguments

40 / 40

40. A variable name cannot start with a number

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.