posted Apr 24, 2018, 6:23 AM by Konstantinovich Samuel
If you want to have your profile page entered into the competition fill this out please:

Prime testing.
1. Check if a number is prime.
isPrime(2) is true
isPrime(1) is false
isPrime(9) is false
isPrime(13) is true

2. Generate the nth prime number.
nthPrime(1) is 2
nthPrime(2) is 3
nthPrime(3) is 5

3. Generate n prime numbers. *this is what we want*
generatePrimes(3) is [2,3,5]

Change A text file into HTML:

Take the alice Chapter 1, open it in python, and print a complete webpage (doctype header etc.)

This should print the book in a nice format. You should use
s = s.replace (old, new)
to change some of the text so that it looks better. (hint: new lines requires this)

Hint: Since windows uses \r\n for newlines, and linux uses \n for newlines files can be fixed with this:
if "\r\n" in text:   
    text = text.replace('\r\n',"\n")
Konstantinovich Samuel,
Apr 24, 2018, 6:24 AM