[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python can connect to database systems.

2 / 40

2. python has two primitive loop commands:

  • while loops
  • for loops

3 / 40

3. The for loop does not require an indexing variable to set beforehand

4 / 40

4.

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.

5 / 40

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

6 / 40

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

7 / 40

7.

How to copy one list to another in python?

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

8 / 40

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

9 / 40

9. The else keyword catches anything which isn’t caught by the preceding conditions.

10 / 40

10. Comparison operators are not  used to compare two values

11 / 40

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

12 / 40

12.

 What is output of: 35 == 35.0

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

13 / 40

13. Camel Case
Each word, except the first, starts with a capital letter:

14 / 40

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

15 / 40

15.

What will be the output of above Python code?

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

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

16 / 40

16.

Which is the correct operator for power(xy)?

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

23 / 40

23.

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

a. [ ]

b. { }

c. ( )

d. None of the above

24 / 40

24. Who developed Python Programming Language?

25 / 40

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

26 / 40

26.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

27 / 40

27.

 ____________________ 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

28 / 40

28.

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

29 / 40

29.

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

30 / 40

30.

 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.

31 / 40

31.

What is the value of the expression 100 / 25?

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

32 / 40

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

33 / 40

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

34 / 40

34. Python can be used to handle big data and perform complex mathematics.

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

39 / 40

39.

Which function overloads the >> operator?

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

40 / 40

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

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.