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

 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. Most recent major version of Python is Python 3

4 / 40

4. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8. Python is an interpreted programming language

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

13 / 40

13. python file can also run on command line

14 / 40

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

15 / 40

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

16 / 40

16. You can also have an else without the elif

17 / 40

17. Comments can be used to explain Python code.

18 / 40

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

19 / 40

19.

How to copy one list to another in python?

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

20 / 40

20. Comments starts with a #

21 / 40

21.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

22 / 40

22.

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.

23 / 40

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

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.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

26 / 40

26. The format() method takes the passed arguments

27 / 40

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

28 / 40

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

29 / 40

29.

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

30 / 40

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

31 / 40

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

32 / 40

32.

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

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

33 / 40

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

34 / 40

34.

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

35 / 40

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

36 / 40

36. Python relies on indentation?

37 / 40

37. Variable names are case-sensitive

38 / 40

38.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

39 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

40 / 40

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

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.