[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Variables that are created outside of a function

3 / 40

3.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

4 / 40

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

5 / 40

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

6 / 40

6.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

7 / 40

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

8 / 40

8.

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

9 / 40

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

10 / 40

10.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

11 / 40

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

12 / 40

12. Comments starts with a #

13 / 40

13. To insert characters that are illegal in a string, use an escape character

14 / 40

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

15 / 40

15.

 What is output of: 35 == 35.0

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

16 / 40

16.

What is the value of the expression 100 / 25?

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

17 / 40

17.

Which function overloads the >> operator?

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

18 / 40

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

19 / 40

19. Camel Case
Each word, except the first, starts with a capital letter:

20 / 40

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

21 / 40

21.

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

a. 2

b. 3

c. 5

d. Multiple times

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.

How to copy one list to another in python?

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

24 / 40

24. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

25 / 40

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

26 / 40

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

27 / 40

27. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

28 / 40

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

29 / 40

29. With the break statement we can stop the loop before it has looped through all the items

30 / 40

30. Who developed Python Programming Language?

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

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. Comments can’t be used to prevent execution when testing code.

38 / 40

38.

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

39 / 40

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

40 / 40

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

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.