[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. Operators are used to perform operations on variables and values

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7.

How to copy one list to another in python?

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

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.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. Python can be treated in a procedural way, an object-oriented way or a functional way.

14 / 40

14. python has two primitive loop commands:

  • while loops
  • for loops

15 / 40

15.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

16 / 40

16.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

17 / 40

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

 

18 / 40

18.

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

19 / 40

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

20 / 40

20. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

21 / 40

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

22 / 40

22.

 What is output of: 35 == 35.0

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

23 / 40

23. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

24 / 40

24. Python is a  high-level programming language.

25 / 40

25. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

26 / 40

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

27 / 40

27. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

28 / 40

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

29 / 40

29. Extension of all Python  Programme are .py

30 / 40

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

31 / 40

31.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

32 / 40

32. Comments can be used to explain Python code.

33 / 40

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

34 / 40

34. Python can be install on both  Linux and  Windows

35 / 40

35.

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

36 / 40

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

37 / 40

37. Python has various versions available

38 / 40

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

39 / 40

39. During Installation Make sure to select both the checkboxes at the bottom .

40 / 40

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

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.