[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

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

2 / 40

2. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

3 / 40

3.

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

4 / 40

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

5 / 40

5. Python can connect to database systems.

6 / 40

6. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

7 / 40

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

8 / 40

8. You can use the pop() method to remove an element from the array

9 / 40

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

10 / 40

10.

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

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

11 / 40

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

12 / 40

12.

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

13 / 40

13. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

14 / 40

14. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

19 / 40

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

20 / 40

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

21 / 40

21. Python is a  high-level programming language.

22 / 40

22. The format() method takes the passed arguments

23 / 40

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

24 / 40

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

25 / 40

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

a. 5

b. 3

c. 6

d. 7

26 / 40

26.

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.

27 / 40

27.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

28 / 40

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

29 / 40

29.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

30 / 40

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

31 / 40

31. python file can also run on command line

32 / 40

32. Comments can be used to explain Python code.

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

39 / 40

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

40 / 40

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

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.