[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

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.

3 / 40

3.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

4 / 40

4.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

5 / 40

5. Comments can be used to explain Python code.

6 / 40

6.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

7 / 40

7.

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

8 / 40

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

9 / 40

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

10 / 40

10. Variables that are created outside of a function

11 / 40

11. A variable name can only contain alpha-numeric characters and
underscores

12 / 40

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

13 / 40

13. Comments starts with a #

14 / 40

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

15 / 40

15. Variable names are case-sensitive

16 / 40

16. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

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

19 / 40

19. Python relies on indentation?

20 / 40

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

21 / 40

21.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

22 / 40

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

23 / 40

23.

How to copy one list to another in python?

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

24 / 40

24. You can also have an else without the elif

25 / 40

25.

Which is the correct operator for power(xy)?

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

26 / 40

26. Python can be treated in a procedural way, an object-oriented way or a functional way.

27 / 40

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

28 / 40

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

29 / 40

29.

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

a. Define

b. DEF

c. def

d. Def

30 / 40

30.

 Select the correct example of complex datatype in Python

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

31 / 40

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

32 / 40

32. Python can connect to database systems.

33 / 40

33. You can have if statements inside if statements, this is called nested if statements.

34 / 40

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

35 / 40

35.

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

36 / 40

36.

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

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

37 / 40

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

38 / 40

38.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

39 / 40

39.

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.

40 / 40

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

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.