02
index
/home/kofron/Work/Teaching/2024-2025/nprg065/solutions/02.py

 
Modules
       
math

 
Functions
       
countprimes(low, high)
Prints the primes between low and high using the Eratosthenes algorithm.
In case the low argument is less than the high argument, the arguments are swapped.
 
Keyword arguments:
low -- the first limit of the interval
high -- the second limit of the interval
 
Returns: Nothing
erasto(n)
Applies the Eratosthenes algorithm up to number n
:param n: the high limit on the numbers
:return: the list of primes up to n
multi(x)
Prints out a multiplication table
:param i: the base for the table
:return: nothing
nnn(n)
Prints value of n+nn+nnn for a given n. Note here that n is string,
so 3 * n is nnn (still a string) that is eventually transformed to
int.
:type n: str
:param n: the input number
:return: the value of n+nn+nnn
pathelem(path)
Prints out particular path elements passed as the argument
:type path: str
:param path: the string to be parsed
:return: nothing
perms(pref, s)
Computes and prints the permutations of string @param s with the given prefix @pref
:param pref: the constant prefix that will be printed out in front of each string
:param s: the string whose permutations are generated and printed
:return: nothing
printsubtrees(level, number)
printtree(level)
printtreeline(linelevel, number, level)