Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
lehrkraefte:blc:informatik:ffprg1-2019:challenges [2019/02/05 12:53] Ivo Blöchliger [Vorgehen] |
lehrkraefte:blc:informatik:ffprg1-2019:challenges [2019/02/05 17:48] (current) mirco_buechel |
||
---|---|---|---|
Line 15: | Line 15: | ||
==== hello ==== | ==== hello ==== | ||
<code python> | <code python> | ||
+ | # Autor: Ivo Bloechliger | ||
def hello(): | def hello(): | ||
print(" | print(" | ||
</ | </ | ||
==== hifive ==== | ==== hifive ==== | ||
+ | <code python> | ||
+ | # mirco | ||
+ | def hifive(n): | ||
+ | for i in range(n): | ||
+ | print(' | ||
+ | print(' | ||
+ | </ | ||
+ | |||
==== rampe ==== | ==== rampe ==== | ||
+ | <code python> | ||
+ | # mirco | ||
+ | def rampe(n): | ||
+ | for i in range(n): | ||
+ | print((i+1)*'#' | ||
+ | </ | ||
==== tree ==== | ==== tree ==== | ||
+ | <code python> | ||
+ | # mirco | ||
+ | def tree(n): | ||
+ | for i in range(n): | ||
+ | print((n-1-i)*' | ||
+ | print((n-1)*' | ||
+ | </ | ||
==== teiler ==== | ==== teiler ==== | ||
+ | <code python> | ||
+ | # mirco | ||
+ | def teiler(n): | ||
+ | for i in range(n): | ||
+ | if i!=0: | ||
+ | if n%i==0 : | ||
+ | print(i) | ||
+ | print(n) | ||
+ | </ | ||
==== prim ==== | ==== prim ==== | ||
+ | <code python> | ||
+ | # mirco | ||
+ | def prim(n): | ||
+ | x=0 | ||
+ | for i in range(n): | ||
+ | if i!=0 and i!=1: | ||
+ | if n%i==0: | ||
+ | x=1 | ||
+ | if n==0 or n==1: | ||
+ | x=1 | ||
+ | if x==1: | ||
+ | print(str(n)+' | ||
+ | if x!=1: | ||
+ | print(str(n)+' | ||
+ | </ | ||
==== grid ==== | ==== grid ==== | ||
+ | <code python> | ||
+ | # mirco | ||
+ | def grid(x,y): | ||
+ | for i in range(y): | ||
+ | print(x*' | ||
+ | print(x*' | ||
+ | print(x*' | ||
+ | </ | ||