[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

3 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

4 / 40

4.

What will be the output of below Python code?

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

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

5 / 40

5.

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

a. 2

b. 3

c. 5

d. Multiple times

6 / 40

6.

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

7 / 40

7. Who developed Python Programming Language?

8 / 40

8.

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

a. [ ]

b. { }

c. ( )

d. None of the above

9 / 40

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

10 / 40

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

11 / 40

11. Python is a  high-level programming language.

12 / 40

12.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

13 / 40

13.

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.

14 / 40

14. python has two primitive loop commands:

  • while loops
  • for loops

15 / 40

15.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

16 / 40

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

17 / 40

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

18 / 40

18. Comments starts with a #

19 / 40

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

20 / 40

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

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

21 / 40

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

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 is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

24 / 40

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

25 / 40

25. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

26 / 40

26. Official site of python is www.python.org

27 / 40

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

28 / 40

28. Python relies on indentation?

29 / 40

29. The else keyword catches anything which isn’t caught by the preceding conditions.

30 / 40

30. You can also have an else without the elif

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34. Bitwise operators are used to compare (binary) numbers

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

40 / 40

40.

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

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

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.