Docsity

PythonPython notes and pdf content for reference of the students Python notes and pdf cont, Summaries of Computer Science

Toggle sidebar
bg1
Hello, Python
1.
!!!a. 6
!!!b. 20.0
!!!c. 4.5
!!!d. -4.5
!!!e. -5
!!!f. 1
!!!g. 1.0
!!!h. 1.0
!!!i. -1
!!!j. 1
!!!k. -4.5
!!!l. 19
!!!m. 35
2. The unary plus operator returns the value of its argument unchanged.
3.
!!!a. temp = 24
!!!b. temp = 1.8 * temp + 32
4.
!!!a. (6 * 3), then (7 * 4), then (18 + 28).
!!!b. (3 /4), then (5 + 0.75).
!!!c. (3 ** 4), (2 * 81), then (5 - 162).
5.
!!!a. x = 10.5
!!!b. y = 4
!!!c. x = x + y
!!!!!!x refers to 14.5 and y refers to 4.
6.
•(x - x) is evaluated, yielding 0.
• 0 is added to the value at x, which is 3, yielding 3.
pf2

Partial preview of the text

Download PythonPython notes and pdf content for reference of the students Python notes and pdf cont and more Summaries Computer Science in PDF only on Docsity!

Hello, Python

a. 6 b. 20. c. 4. d. -4. e. - f. 1 g. 1. h. 1. i. - j. 1 k. -4. l. 19 m. 35

  1. The unary plus operator returns the value of its argument unchanged.
  2. a. temp = 24 b. temp = 1.8 * temp + 32
  3. a. (6 * 3), then (7 * 4), then (18 + 28). b. (3 /4), then (5 + 0.75). c. (3 ** 4), (2 * 81), then (5 - 162).
  4. a. x = 10. b. y = 4 c. x = x + y x refers to 14.5 and y refers to 4.
    • (x - x) is evaluated, yielding 0.
    • 0 is added to the value at x, which is 3 , yielding 3.
  • finally the result, 3 , is assigned to variable x.

4 + a

  1. b, e.