[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

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

3 / 40

3.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

4 / 40

4.

How to copy one list to another in python?

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

5 / 40

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

6 / 40

6. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

7 / 40

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

8 / 40

8.

 Select the correct example of complex datatype in Python

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

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

a. True

b. False

13 / 40

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

14 / 40

14. Extension of all Python  Programme are .py

15 / 40

15.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

16 / 40

16. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

17 / 40

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

18 / 40

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

19 / 40

19.

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.

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23.

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

24 / 40

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

25 / 40

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

26 / 40

26.

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

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

27 / 40

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

28 / 40

28. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

29 / 40

29. Python can be used on a server to create web applications?

30 / 40

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

31 / 40

31.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

32 / 40

32.

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

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

33 / 40

33. Variable names are case-sensitive

34 / 40

34.

What will be the output of below Python code?

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

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

35 / 40

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

36 / 40

36.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

37 / 40

37. Who developed Python Programming Language?

38 / 40

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

39 / 40

39. You can also have an else without the elif

40 / 40

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

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.