[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python has various versions available

2 / 40

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

3 / 40

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

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

4 / 40

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

5 / 40

5. python file can also run on command line

6 / 40

6.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

7 / 40

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

8 / 40

8. During Installation Make sure to select both the checkboxes at the bottom .

9 / 40

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

10 / 40

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

11 / 40

11. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

12 / 40

12. You can also have an else without the elif

13 / 40

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

14 / 40

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

15 / 40

15. Comments can be used to make the code more readable.

16 / 40

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

17 / 40

17. Python relies on indentation?

18 / 40

18.

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

24 / 40

24.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

25 / 40

25.

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.

26 / 40

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

27 / 40

27.

How to copy one list to another in python?

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

28 / 40

28.

 Select the correct example of complex datatype in Python

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

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

33. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

34 / 40

34.

What will be the output of below Python code?

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

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

35 / 40

35. Who developed Python Programming Language?

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. + operator is used  to get output of multiple variables

40 / 40

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

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.