[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

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

2 / 40

2.

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

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

3 / 40

3. Strings in python are surrounded by either single quotation marks, or double quotation marks

4 / 40

4.

What is the value of the expression 100 / 25?

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9.

How to copy one list to another in python?

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

10 / 40

10.

Which function overloads the >> operator?

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

11 / 40

11.

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

12 / 40

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

13 / 40

13.

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

14 / 40

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

15 / 40

15.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

16 / 40

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

17 / 40

17. Most recent major version of Python is Python 3

18 / 40

18.

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

19 / 40

19. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

20 / 40

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

21 / 40

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

22 / 40

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

a. 5

b. 3

c. 6

d. 7

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26.

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

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

29 / 40

29. Python can be install on both  Linux and  Windows

30 / 40

30. A variable name must start with a letter or the underscore character

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35. Python can be used to handle big data and perform complex mathematics.

36 / 40

36.

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

a. Define

b. DEF

c. def

d. Def

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

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.