Pyton Coding
Pyton Coding
Example 1:
first number=5
second number=6
answer= first number + second number
print (answer)
Example 2:
a=name. CAPITALIZE()
b=name. UPPER()
c=name. lower()
d=name. string()
if=0
N/B: the spaces in a python letters are counted as zeros, while number are counted
from one
Example 3:
F A V O U R B A S S E Y
0 1 2 3 4 5 6 7 8 9 10 11 12 13
#Working with element
a1=name[10] S
a2=name[2] A
a3=name[13] Y
Example 4:
list_of_numbers=[1,2,33,45,87,90,100]
p1=list_of_numbers[3]
p2=list_of_numbers[5]
p3=p1+p2
print[p3]
ASSIGNMENT
1. Create a variable called 'course' and assign a string name. INFORMATION AND
MEDIA STUDIES. Generate the following output
a. Form
b. Dies
c. Rat
d. Onions
e. Room
f. Insert
g. Student
h. Sat
I. Format
j. Did
k. Store
l. Or
ANSWERS
1. I N F O R M A T I O N A N D M E D I A S T U D I
E S
0 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