2 files modified
4 files added
New file |
| | |
| | | #! /usr/bin/evn python |
| | | import random |
| | | |
| | | random.seed(5643) |
| | | experiments = 500 |
| | | dice_roll = tuple(random.randint(1, 6) for r in range(0, experiments)) |
| | | absolute_frequency = tuple((face, len([f for f in dice_roll if f == face])) |
| | | for face in range(1, 6 + 1) |
| | | ) |
| | | print(absolute_frequency) |
| | | |
| | | relative_frequency = tuple( |
| | | (f[0], f[1]/experiments) for f in absolute_frequency |
| | | ) |
| | | |
| | | print(relative_frequency) |
| | |
| | | import sys |
| | | |
| | | n = int(sys.argv[1]) |
| | | |
| | | # permutations = [[0]] |
| | | # element = 1 |
| | | # n = 2 |
| | | # |
| | | # next_permutations = [] |
| | | # for p in permutations: |
| | | # for position in range(0, len(p) + 1): |
| | | # new_permutation = p.copy() |
| | | # new_permutation.insert(position, element) |
| | | # next_permutations.append(new_permutation) |
| | | # print(next_permutations) |
| | | """ |
| | | function permutation(set: []) -> [] |
| | | if size(set) < 2 return [set]; |
| | | result = [] |
| | | for idx, e in set: |
| | | other_elements = set \ {e} |
| | | other_permutations = permutation(other_elements) |
| | | for p in other_permutations: |
| | | result.append( [e].concat(p) ) |
| | | end |
| | | end |
| | | return result |
| | | end |
| | | """ |
| | | |
| | | permutations = [[]] |
| | | element = n - 1 |
New file |
| | |
| | | #! /usr/bin/env python |
| | | import turtle |
| | | import math |
| | | |
| | | num_of_petal = 60 |
| | | petal_length = 100 |
| | | # winkel sind in Degree |
| | | alpha = 90 / num_of_petal |
| | | beta = 2 * alpha |
| | | gamma = 180 - beta |
| | | |
| | | # abgeleitete Länge |
| | | side_length = petal_length * math.cos(math.radians(alpha)) |
| | | |
| | | for petal in range(0, num_of_petal): |
| | | direction = petal * (360 / num_of_petal) |
| | | turtle.home() |
| | | turtle.left(direction + alpha) |
| | | turtle.fd(side_length) |
| | | turtle.right(beta) |
| | | turtle.fd(side_length) |
| | | turtle.right(gamma) |
| | | turtle.fd(side_length) |
| | | turtle.right(beta) |
| | | turtle.fd(side_length) |
| | | |
| | | turtle.done() |
| | | |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | import sys |
| | | a = int(sys.argv[1]) |
| | | b = int(sys.argv[2]) |
| | | c = int(sys.argv[3]) |
| | | |
| | | if a < b: |
| | | first, second = a, b |
| | | else: |
| | | first, second = b, a |
| | | |
| | | if c < first: |
| | | print(c, first, second) |
| | | elif c > second: |
| | | print(first, second, c) |
| | | else: |
| | | print(first, c , second) |
New file |
| | |
| | | American Express 378282246310005 |
| | | American Express 371449635398431 |
| | | American Express Corporate 378734493671000 |
| | | Diners Club 30569309025904 |
| | | Discover 6011111111111117 |
| | | Discover 6011000990139424 |
| | | JCB 3530111333300000 |
| | | JCB 3566002020360505 |
| | | MasterCard 2221000000000009 |
| | | MasterCard 2223000048400011 |
| | | MasterCard 2223016768739313 |
| | | MasterCard 5555555555554444 |
| | | MasterCard 5105105105105100 |
| | | Visa 4111111111111111 |
| | | Visa 4012888888881881 |
| | | Visa 4222222222222 |
| | |
| | | for t in range(0,7): |
| | | s = (7 - t) % 7 + 1 |
| | | print(f"{t} → {s}") |
| | | |
| | | |
| | | |
| | | |