[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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.

2 / 40

2.

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.

3 / 40

3. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

4 / 40

4.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

5 / 40

5.

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

6 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

7 / 40

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

8 / 40

8. Comparison operators are not  used to compare two values

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

What will be the output of below Python code?

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

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

13 / 40

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

14 / 40

14. Indentation refers to the spaces at the beginning of a code line.

15 / 40

15.

What is the value of the expression 100 / 25?

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

16 / 40

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

17 / 40

17.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

18 / 40

18. A variable name cannot start with a number

19 / 40

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

20 / 40

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

21 / 40

21.

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

22 / 40

22.

Which is the correct operator for power(xy)?

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

23 / 40

23.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

24 / 40

24. Snake Case
Each word is separated by an underscore character:

25 / 40

25.

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

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

26 / 40

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

27 / 40

27.

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

28 / 40

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

29 / 40

29.

 ____________________ 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

30 / 40

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

31 / 40

31.

How to copy one list to another in python?

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

32 / 40

32. Python can be install on both  Linux and  Windows

33 / 40

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

a. 5

b. 3

c. 6

d. 7

34 / 40

34. python has two primitive loop commands:

  • while loops
  • for loops

35 / 40

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

36 / 40

36. You can also have an else without the elif

37 / 40

37. The for loop does not require an indexing variable to set beforehand

38 / 40

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

39 / 40

39.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

40 / 40

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

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.