You are on page 1of 3

Assignment on Python Programming

Emmanuel Kaase Ukoso 9th September, 2012

1
1.1

Creation of script
Script1.py

print "Welcome to Python programming" Welcome to Python programming

1.2

Script2.py

print "Name: Emmanuel Kaase Ukoso" print "Age: 23 years" print "Country: Nigeria" Name: Emmanuel Kaase Ukoso Age: 23 years Country: Nigeria

2
2.0.1

User input
Script3.py

q = raw_input("Enter a chain of characters \n") print q v = input("Enter a number \n") print v Enter a chain of characters This is my world This is my world Enter a number 9876543210 9876543210 1

2.0.2

Script4.py

from math import* r=input("enter a number \n") # You have to enter any number as radius v=(4/3.)*pi*(r**3) # Formular for volume of a sphere print v enter a number 21 38792.3860865 2.0.3 Script5.py

print"The number of books to be baught by AIMS is" n=36 print n print"The cost of one book is" C=str(54000)+"FCFA" #the cost of one book print C print"The amount to be paid to all 36 books is" from math import* Tc=str(54000*36) +"FCFA"#price of all the book print Tc print"The sending cost of one book:" q_1=str(800)+"FCFA" #sending cost of the first book print q_1 print"The sending cost of each of the 35 remaining ones is:" q_2=str(250)+"FCFA" #sending cost of 35 books print q_2 print"The total total sending cost amount is:" Sc=str(800+(250*35))+"FCF" print Sc print"The discount on the total price the books is" print"15%" print"price of books including the discount is:" p_1=str((54000*36)-(15*(54000*36)/100))+"FCFA" print p_1 print"The total amount including sending cost,discount is" p=str((54000*36)-(15*(54000*36)/100)+800+(250*35))+"FCFA" print p 2

The number of books to be baught by AIMS is 36 The cost of one book is 54000FCFA The amount to be paid to all 36 books is 1944000FCFA The sending cost of one book: 800FCFA The sending cost of each of the 35 remaining ones is: 250FCFA The total total sending cost amount is: 9550FCF The discount on the total price the books is 15% price of books including the discount is: 1652400FCFA The total amount including sending cost,discount is 1661950FCFA

You might also like