Create a project folder username_a01
. Place all your tasks python files(t01.py
,
t02.py
,t03.py
) and the testing file testing.txt
inside this folder. Upon
completing your tasks, export your projrct folder to username_a01.zip
file, validate it, and
submit it to the dropbox by the due date.
Write and test a Python module named . Copy
your testing to
testing.txt
.
This program demonstrates your understanding of the use of single,
double and triple quotes by using four (4) print
functions to print the following four sets of text:
The program may use only one print
function per piece of
text. Use no other print
functions in your program - no
titles or blank lines. The program must include one use of each of the
following around the text in the print
function:
The program may not use any escape characters in its text, i.e it may
not use \n
or quote escaping: \"
or \'
.
Partial testing:
Write and test a PyDev module named . Copy
your testing to
testing.txt
.
This program asks the user for a length in inches and prints the equivalent length in metres. Use 0.0254 as the conversion factor from inches to m.
Sample execution:
Length in inches: 68 Length in m: 1.7271999999999998
Run the program with three different sets of inputs.
Partial testing:
Write and test a PyDev module named . Copy
your testing to
testing.txt
.
This program calculates and prints compound interest. Compound interest is calculated by:
\( A = P \left(1 + \frac{r}{n} \right)^{nt} \)
where \(P\) is the principal amount, \(r\) is the annual rate of interest (as a decimal), \(t\) is the number of years the amount is deposited or borrowed for, \(n\) is the number of times the interest is compounded per year, and the result \(A\) is the amount of money accumulated after \(t\) years.
Sample execution:
Principal: $5000.00 Interest: 5.0 Number of years: 10 Number of times interest compounded per year: 12 Balance: $ 8235.0474884514
Run the program with three different sets of inputs.
Partial testing:
Partial testing of testing.txt: