[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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.

2 / 40

2. Python can connect to database systems.

3 / 40

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

4 / 40

4.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

5 / 40

5.

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.

6 / 40

6.

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

7 / 40

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

8 / 40

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

9 / 40

9. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

10 / 40

10. python has two primitive loop commands:

  • while loops
  • for loops

11 / 40

11.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

12 / 40

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

13 / 40

13. Python has various versions available

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

18 / 40

18.

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

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

19 / 40

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

20 / 40

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

21 / 40

21.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

22 / 40

22. Arrays are used to store multiple values in one single variable.

23 / 40

23. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

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

24 / 40

24.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

25 / 40

25.

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

26 / 40

26. Most recent major version of Python is Python 3

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30. Extension of all Python  Programme are .py

31 / 40

31. python file can also run on command line

32 / 40

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

33 / 40

33.

How to copy one list to another in python?

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

39 / 40

39.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

40 / 40

40.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

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.