-
Notifications
You must be signed in to change notification settings - Fork 0
/
lesson1a.py
33 lines (28 loc) · 1.25 KB
/
lesson1a.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
print("Hello,world....")
print(100)
print(4+6)
#This is a comment
#In python codes starts from the edge otherwise syntax error is generated(unexpected indent)
#Beacause python an indented language
#A function takes input, process the input (logic) and then generates an output
#e,g print(), input(),range()........
#Learning a programming language we always follow the following building blocks
#1. Variables: used to store data on a program
#2. Data types: they specify the type of data being processed in a program e,g numbers, decimals, letters (strings)
#3. Conditions/Decimation/control structures: Apply the code logic(if, if else, else if)
#4. Loopings/Iterations: Execute a code a number of times depending on the conditions(for loops, while loop)
#5. Functions
#6. Object Oriented Programming(Classes and objects), e,g Python ,Java ,JavaScript, C++,C#
#` Procedural e,g C
#7. Exception Handling : advanced
#8. Modules/Libraries/Frameworks
#VARIABLES In Python
#Any name that is used tostore value in a progam, created on the left side
#Assignment: giving a value to a variables we use equal sign(=)
#Declare a variable disrtance, and assign its value 20.9, then output it to the screen
myname="Brownmark"
print(myname)
myage=22
print(myage)
distance=20.9
print(distance)