[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

3 / 40

3.

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

4 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

5 / 40

5.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

6 / 40

6. The format() method takes unlimited number of arguments

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

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

a. [ ]

b. { }

c. ( )

d. None of the above

11 / 40

11. A variable name cannot start with a number

12 / 40

12.

 What is output of: 35 == 35.0

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

13 / 40

13.

What will be the output of above Python code?

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

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

14 / 40

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

15 / 40

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

16 / 40

16. Python is an interpreted programming language

17 / 40

17.

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

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

22 / 40

22.

How to copy one list to another in python?

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

23 / 40

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

24 / 40

24. Python is a  high-level programming language.

25 / 40

25.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

26 / 40

26. Comments can be used to explain Python code.

27 / 40

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

28 / 40

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

29 / 40

29.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

30 / 40

30.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

31 / 40

31. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

32 / 40

32. python has two primitive loop commands:

  • while loops
  • for loops

33 / 40

33. + operator is used  to get output of multiple variables

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. Is there any comments in  following codes

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

 

36 / 40

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

37 / 40

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

38 / 40

38. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

39 / 40

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

40 / 40

40. Comparison operators are not  used to compare two values

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.