Commit 620b424e authored by tihmels's avatar tihmels

UPDATE Projektstruktur

parent 332150e4
......@@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/projectmood" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Python 3.6.3 virtualenv at ~/Jetbrains/PyCharm/Medienverarbeitung/medienverarbeitung17.projectmood/venv" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.6.3 virtualenv at ~/.local/share/virtualenvs/medienverarbeitung17.projectmood-swI6hODc" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PackageRequirementsSettings">
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.3 virtualenv at ~/Jetbrains/PyCharm/Medienverarbeitung/medienverarbeitung17.projectmood/venv" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.3 virtualenv at ~/.local/share/virtualenvs/medienverarbeitung17.projectmood-swI6hODc" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
......@@ -5,31 +5,15 @@ verify_ssl = true
name = "pypi"
[requires]
python_version = '3.6'
[packages]
alabaster = "==0.7.10"
Babel = "==2.5.1"
certifi = "==2017.7.27.1"
chardet = "==3.0.4"
docutils = "==0.14"
idna = "==2.6"
imagesize = "==0.7.1"
"Jinja2" = "==2.9.6"
MarkupSafe = "==1.0"
numpy = "==1.13.3"
opencv-python = "==3.3.0.10"
pbr = "==3.1.1"
Pygments = "==2.2.0"
pytz = "==2017.2"
requests = "==2.18.4"
snowballstemmer = "==1.2.1"
Sphinx = "==1.6.4"
sphinxcontrib-websupport = "==1.0.1"
stevedore = "==1.27.1"
"urllib3" = "==1.22"
virtualenv = "==15.1.0"
virtualenv-clone = "==0.2.6"
virtualenvwrapper = "==4.8.2"
opencv-python = "*"
matplotlib = "*"
[dev-packages]
This diff is collapsed.
class Car:
def __init__(self):
self.speed = 0
self.odometer = 0
self.time = 0
def say_state(self):
print("I'm going {} kph!".format(self.speed))
def accelerate(self):
self.speed += 5
def brake(self):
self.speed -= 5
def step(self):
self.odometer += self.speed
self.time += 1
def average_speed(self):
return self.odometer / self.time
if __name__ == '__main__':
my_car = Car()
print("I'm a car!")
while True:
action = input("What should I do? [A]ccelerate, [B]rake, "
"show [O]dometer, or show average [S]peed?").upper()
if action not in "ABOS" or len(action) != 1:
print("I don't know how to do that")
continue
if action == 'A':
my_car.accelerate()
elif action == 'B':
my_car.brake()
elif action == 'O':
print("The car has driven {} kilometers".format(my_car.odometer))
elif action == 'S':
print("The car's average speed was {} kph".format(my_car.average_speed()))
my_car.step()
my_car.say_state()
\ No newline at end of file
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