[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

3 / 40

3. Python relies on indentation?

4 / 40

4. With the for loop we can execute a set of statements

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

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

12 / 40

12.

 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.

13 / 40

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

14 / 40

14.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18.

What is the data type of print(type(10))

19 / 40

19. Most recent major version of Python is Python 3

20 / 40

20. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

21 / 40

21.

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.

22 / 40

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

23 / 40

23. Who developed Python Programming Language?

24 / 40

24.

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

25 / 40

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

26 / 40

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

27 / 40

27.

Which function overloads the >> operator?

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

28 / 40

28.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

29 / 40

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

30 / 40

30. Python can connect to database systems.

31 / 40

31. Variable names are case-sensitive

32 / 40

32. Is there any comments in  following codes

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

 

33 / 40

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

34 / 40

34.

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.

35 / 40

35. Comments starts with a #

36 / 40

36. Pascal Case
Each word starts with a capital letter:

37 / 40

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

38 / 40

38.

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

39 / 40

39. python has two primitive loop commands:

  • while loops
  • for loops

40 / 40

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

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.