[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

5 / 40

5.

What is the value of the expression 100 / 25?

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

6 / 40

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

7 / 40

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

8 / 40

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

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 an else without the elif

11 / 40

11. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

12 / 40

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

13 / 40

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

14 / 40

14.

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

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20. Variables that are created outside of a function

21 / 40

21. Variable names are case-sensitive

22 / 40

22. Python relies on indentation?

23 / 40

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

24 / 40

24. Comments can be used to explain Python code.

25 / 40

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

26 / 40

26.

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

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

27 / 40

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

28 / 40

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

29 / 40

29. Comments starts with a #

30 / 40

30.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

31 / 40

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

32 / 40

32. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

33 / 40

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

34 / 40

34.

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

35 / 40

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

36 / 40

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

37 / 40

37.

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

38 / 40

38. Bitwise operators are used to compare (binary) numbers

39 / 40

39.

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

40 / 40

40.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

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.