[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

Which function overloads the >> operator?

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

3 / 40

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

4 / 40

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

5 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

6 / 40

6. Python is a  high-level programming language.

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.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

9 / 40

9. Comparison operators are not  used to compare two values

10 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. Python can be treated in a procedural way, an object-oriented way or a functional way.

15 / 40

15.

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

16 / 40

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

17 / 40

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

18 / 40

18.

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.

19 / 40

19. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

20 / 40

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

21 / 40

21. Extension of all Python  Programme are .py

22 / 40

22.

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.

23 / 40

23.

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.

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

29 / 40

29.

How to copy one list to another in python?

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

30 / 40

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

31 / 40

31.

What will be the output of below Python code?

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

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

32 / 40

32.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

33 / 40

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

34 / 40

34. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

35 / 40

35. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

36 / 40

36. What is the output of the given below program?

if 3 + 4 == 7:    print("Hi")else:    print("Know Program")print("Hello")

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

37 / 40

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

38 / 40

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

39 / 40

39.

 What is output of: 35 == 35.0

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

40 / 40

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

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.