[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

Which is the correct operator for power(xy)?

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

3 / 40

3.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

4 / 40

4.

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

5 / 40

5. We can combine strings and numbers by using the format() method

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

8 / 40

8.

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.

9 / 40

9.

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

10 / 40

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

11 / 40

11.

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

12 / 40

12. Comparison operators are not  used to compare two values

13 / 40

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

14 / 40

14. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

15 / 40

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

16 / 40

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

17 / 40

17. You can also have an else without the elif

18 / 40

18.

How to copy one list to another in python?

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

19 / 40

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

20 / 40

20. Comments starts with a #

21 / 40

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

22 / 40

22.

 What is output of: 35 == 35.0

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

23 / 40

23. You can use the append() method to add an element to an array

24 / 40

24.

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30. Python can be install on both  Linux and  Windows

31 / 40

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

32 / 40

32. Bitwise operators are used to compare (binary) numbers

33 / 40

33. The length of an array is always one more than the highest array index.

34 / 40

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

35 / 40

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

a. 5

b. 3

c. 6

d. 7

36 / 40

36. Python can connect to database systems.

37 / 40

37.

 ____________________ 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

38 / 40

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

39 / 40

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

40 / 40

40.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

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.