This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# so definiert man eine Funktion | |
def permutations(numbers): | |
# wenn die Liste nur eine Zahl enthält, | |
# können wir sie direkt zurückgeben | |
if len(numbers) == 1: | |
return [numbers] | |
# die leere Liste hier benutzen wir | |
# um die Ergebnisse zwischenzuspeichern | |
result = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prices = [9, 9, 12, 12, 12, 15, 16, 20] | |
new_prices = [] | |
# The lowest price has to be a reduces price | |
# Then calculate the original price from that | |
# remove both from the prices list and do it again | |
def solve (prices, new_prices): | |
if len(prices) == 0: | |
return new_prices |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import math | |
items = [10, 3, 4, 10] | |
steps = 10 | |
def make(a, b): | |
print(a, b) | |
result = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var tags = { | |
'a': ['b', 'c', 'd'], | |
'b': ['c', 'd'], | |
'c': ['d'], | |
'd': [], | |
'e': [], | |
'f': ['a'] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const tags = { | |
'1': ['2'], | |
'2': ['1', '5'], | |
'3': ['4'], | |
'4': ['3', '5'], | |
'5': ['6'], | |
'6': ['7'], | |
'7': ['8'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Animation</title> | |
<meta name="description" content="FDSAnimation"> | |
<meta name="author" content="katze"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Die Aufgaben aus der Python Bee aus M28_040 | |
Daniel: Eine Funktion, die prüft, ob ein String ein Palindrom ist (Nicht richtig gelöst) | |
Max: Eine Funktion, die prüft, ob jeder erste Buchstabe eines Wortes in einem String großgeschrieben ist (Nicht richtig gelöst) | |
''' | |
def palindrom(s): | |
l = len(s) / 2 | |
for x in xrange(l): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import shuffle | |
from re import match | |
def stringshuffle(s): | |
''' | |
Shuffles a string but keeps the first and last letter of every word at their original position. | |
''' | |
splitted = s.split() | |
shuffled = [] | |
for str in splitted: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.pegelonline.wsv.de/webservices/rest-api/v2/stations/K%C3%96LN.json?includeTimeseries=true&includeCurrentMeasurement=true | |
{ | |
"uuid": "a6ee8177-107b-47dd-bcfd-30960ccc6e9c", | |
"number": "2730010", | |
"shortname": "KÖLN", | |
"longname": "KÖLN", | |
"km": 688.0, | |
"agency": "WSA DUISBURG-RHEIN", | |
"longitude": 6.9633224437726255, |