[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

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

3 / 40

3. Comments can be used to explain Python code.

4 / 40

4.

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

5 / 40

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

6 / 40

6.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

11.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

12 / 40

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

13 / 40

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

14 / 40

14.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

15 / 40

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

16 / 40

16.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

17 / 40

17.

What is the value of the expression 100 / 25?

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

18 / 40

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

19 / 40

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

20 / 40

20.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24. A variable name can only contain alpha-numeric characters and
underscores

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. Python relies on indentation?

27 / 40

27. Most recent major version of Python is Python 3

28 / 40

28. Pip is  not a powerful package management system for Python software packages

29 / 40

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

30 / 40

30.

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

31 / 40

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

 

32 / 40

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

33 / 40

33.

How to copy one list to another in python?

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

34 / 40

34. The format() method takes the passed arguments

35 / 40

35.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

36 / 40

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

37 / 40

37. With the break statement we can stop the loop even if the while condition is true

38 / 40

38. With the for loop we can execute a set of statements

39 / 40

39.

 ____________________ 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

40 / 40

40. Arrays are used to store multiple values in one single variable.

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.