Practical - Python
Practical - Python
The traditional introduction to programming in any language is to display the words ‘Hello World’ on a
computer screen.
(1)
The editing window for Python The runtime window for Python
(2)
Stars()
def Stars(Number):
for counter in range (Number):
print("*", end = "")
Stars(10)
def Celsius(Temperature):
return (Temperature - 32) / 1.8
Celsius(25)
(5) Library routines
Value1 = 10%3
Value2 = 10//3
Value = divmod(10,3)
Value3 = round(6.97354, 2)
from random import random
Value4 = random()