[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

2 / 40

2.

 Select the correct example of complex datatype in Python

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

3 / 40

3.

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

a. 2

b. 3

c. 5

d. Multiple times

4 / 40

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

5 / 40

5. Python can be install on both  Linux and  Windows

6 / 40

6. Comments can’t be used to prevent execution when testing code.

7 / 40

7. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

8 / 40

8.

What will be the output of below Python code?

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

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

9 / 40

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

10 / 40

10.

How to copy one list to another in python?

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

11 / 40

11. Who developed Python Programming Language?

12 / 40

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

13 / 40

13. Python allows you to extract the values into variables.

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

19 / 40

19. Python is a  high-level programming language.

20 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

21 / 40

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

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. Arithmetic operators are used with numeric values to perform common mathematical operations

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27. Pascal Case
Each word starts with a capital letter:

28 / 40

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

29 / 40

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

30 / 40

30. Comments can be used to explain Python code.

31 / 40

31. A variable name cannot start with a number

32 / 40

32.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

33 / 40

33.

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.

34 / 40

34.

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

35 / 40

35.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40.

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

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.