Fundamentals of Python Programming [Part 1]
Fundamentals of Python Programming [Part 1]
PyCharm IDE
Spyder IDE
objects are
scalar (cannot be subdivided)
non-scalar (have internal structure that can be accessed)
>>> type(5)
int
>>> type(3.0)
float
>>> float(3)
3.0
>>> int(3.9)
3
Shell only:
>>> 3+2
5
4 * 3
4 * 3 + 9
4 * 3 + 9 / 5
**
* / // %
+ -
Fundamentals of Computer & Programming 53
Simple Operations
4-5+6**2/4**3%7
((4-5)+(((6**2)/(4**3))%7))
** (1) ** (2)
/ (3)
%(4)
- (5)
+ (6)
pi = 3.14159
1
pi_approx = 22/7
pi = 3.14159
radius = 2.2
area = pi*(radius**2)
romania_gold = romania_gold + 1
print(total_gold)
Question
74
74
74
75