[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. python file can also run on command line

4 / 40

4.

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

5 / 40

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

6 / 40

6. Variable names are case-sensitive

7 / 40

7.

 ____________________ 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

8 / 40

8.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

9 / 40

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

10 / 40

10. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

11 / 40

11. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

12 / 40

12. With the break statement we can stop the loop even if the while condition is true

13 / 40

13. Python  was created by Guido van Rossum, and released in 1999.

14 / 40

14. Who developed Python Programming Language?

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19.

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

20 / 40

20. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

21 / 40

21.

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

22 / 40

22. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

23 / 40

23. You can also have an else without the elif

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. Comments can be used to make the code more readable.

26 / 40

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

27 / 40

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

28 / 40

28. Variables that are created outside of a function

29 / 40

29. Extension of all Python  Programme are .py

30 / 40

30.

Which function overloads the >> operator?

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

31 / 40

31. Python can connect to database systems.

32 / 40

32.

Which is the correct operator for power(xy)?

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

33 / 40

33.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

34 / 40

34.

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

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

35 / 40

35. Most recent major version of Python is Python 3

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

40 / 40

40. Pip is  not a powerful package management system for Python software packages

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.