[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

a. 5

b. 3

c. 6

d. 7

2 / 40

2. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6. + operator is used  to get output of multiple variables

7 / 40

7. The format() method takes unlimited number of arguments

8 / 40

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

9 / 40

9. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. Comments starts with a #

15 / 40

15. We can combine strings and numbers by using the format() method

16 / 40

16.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

23 / 40

23. python has two primitive loop commands:

  • while loops
  • for loops

24 / 40

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

25 / 40

25.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

26 / 40

26.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

27 / 40

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

28 / 40

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

29 / 40

29.

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

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

30 / 40

30. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

31 / 40

31.

 What is output of: 35 == 35.0

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37.

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.

38 / 40

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

39 / 40

39. Which of the following is the correct extension of the Python file?

40 / 40

40.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

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.