[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Extension of all Python  Programme are .py

3 / 40

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

4 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

5 / 40

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

a. 5

b. 3

c. 6

d. 7

6 / 40

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

7 / 40

7.

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

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

8 / 40

8.

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

9 / 40

9. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

10 / 40

10.

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

11 / 40

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

12 / 40

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

13 / 40

13.

How to copy one list to another in python?

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

14 / 40

14.

 What is output of: 35 == 35.0

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

15 / 40

15. Arithmetic operators are used with numeric values to perform common mathematical operations

16 / 40

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

17 / 40

17.

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

a. [ ]

b. { }

c. ( )

d. None of the above

18 / 40

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

19 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

20 / 40

20. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24. print() function is often used to output variables.

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

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

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

32 / 40

32.

What is the data type of print(type(10))

33 / 40

33.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

34 / 40

34. Is there any comments in  following codes

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

 

35 / 40

35.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

36 / 40

36. With the break statement we can stop the loop before it has looped through all the items

37 / 40

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

38 / 40

38. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

39 / 40

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

40 / 40

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

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.