[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

2.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

3 / 40

3.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

4 / 40

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

5 / 40

5. Python can be install on both  Linux and  Windows

6 / 40

6.

 ____________________ 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

7 / 40

7. Python has a set of built-in methods that you can use on lists/arrays

8 / 40

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

9 / 40

9. Who developed Python Programming Language?

10 / 40

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

11 / 40

11. You can use the pop() method to remove an element from the array

12 / 40

12.

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

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

13 / 40

13.

How to copy one list to another in python?

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

14 / 40

14. An array can hold many values under a single name

15 / 40

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

16 / 40

16. Python has various versions available

17 / 40

17.

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

18 / 40

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

19 / 40

19. You can return a range of characters by using the slice syntax

20 / 40

20. What is the output of the given below program?

if 3 + 4 == 7:    print("Hi")else:    print("Know Program")print("Hello")

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

21 / 40

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

22 / 40

22. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

23 / 40

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

24 / 40

24. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

25 / 40

25.

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

26 / 40

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

27 / 40

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

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. The list’s remove() method only removes the first occurrence of the specified value.

30 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34.

 What is output of: 35 == 35.0

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

35 / 40

35. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

36 / 40

36.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

37 / 40

37.

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

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

38 / 40

38.

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.

39 / 40

39. A variable name cannot start with a number

40 / 40

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

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.