Skip to content
Snippets Groups Projects
Commit 30fe507d authored by Markus Opolka's avatar Markus Opolka
Browse files

Initial Commit

parents
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
import sys
def multiply(x, y):
pass
def main(args):
value = globals()[args[0]](int(args[1]), int(args[2]))
print(value)
if __name__ == '__main__':
args = sys.argv[1:]
main(args)
#!/usr/bin/env python3
def calc_area(r):
pass
def main():
radius = float(input ("Input the radius of the circle : "))
print(calc_area(radius))
if __name__ == '__main__':
main()
#!/usr/bin/env python3
import sys
def tokenize(string):
pass
def main(args):
the_input = " ".join(args)
print(tokenize(the_input))
if __name__ == '__main__':
args = sys.argv[1:]
main(args)
# Code
git clone https://bi40resu@gitlab.cs.fau.de/bi40resu/python-tutorium.git
# Aufgabe 1
Erweitern Sie das Programm in Aufgabe1.py so, dass man die grundlegenden Rechenoperationen übergeben kann.
- subtract
- add
- multiply
- divide
Boilerplate: Aufgabe1.py
# Aufgabe 2
Schreiben Sie ein Programm, dassdie Fläche eines Kreis anhand des Radius berechnet.
Tipp: Python bietet eine Bibliothek für mathematische Funktionen
Tipp: A = π *
Boilerplate: Aufgabe2.py
# Aufgabe 3
Schreiben Sie eine einfache Tokenizer Funktion um arbiträren Text zu tokenisieren.
# Aufgabe 4
Erweitern Sie die Tokenizer Funktion so, dass Satzzeichen erkannt und behandelt werden.
Beispiel "I'm gonna make him an offer he can't refuse."
Bonus Round: Wie können wir "I'm" tokenisieren?
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment