[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. The format() method takes the passed arguments

2 / 40

2.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

3 / 40

3.

What will be the output of below Python code?

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

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

4 / 40

4. A variable name cannot start with a number

5 / 40

5.

 What is output of: 35 == 35.0

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

6 / 40

6.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

7 / 40

7.

What is the value of the expression 100 / 25?

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

8 / 40

8.

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

9 / 40

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

10 / 40

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

11 / 40

11. Variable names are case-sensitive

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

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

a. 2

b. 3

c. 5

d. Multiple times

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30. Python  was created by Guido van Rossum, and released in 1999.

31 / 40

31. You can also have an else without the elif

32 / 40

32. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

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

33 / 40

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

34 / 40

34. Python relies on indentation?

35 / 40

35.

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

36 / 40

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

37 / 40

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

38 / 40

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

a. 5

b. 3

c. 6

d. 7

39 / 40

39.

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

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

40 / 40

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

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.