Commit 6a9859d9 authored by julian.bauer's avatar julian.bauer
Browse files

Erstelle ein Python-Modul und verwende es im Hauptskript

parent 385383b6
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Python Module called 'example'"""
import numbers
def add(*args):
if all(isinstance(x, numbers.Number) for x in args):
result = sum(args)
else:
result = "".join(map(str, args))
return result
......@@ -2,10 +2,14 @@
# -*- coding: utf-8 -*-
"""Main script"""
import example
one = 1.0 # browser
two = 2.0 # local
three = 3.0 # local fix of conflict
print(one + two + three)
sum = example.add(one, two, three)
print(sum)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment