das Programm hab ich so angelegt das man zunächst den Radius angeben muss und dann das ergebniss A erscheint jedoch funktioniert das einfach nicht und ich hab keine ahnunh was ich falsch mache kann mir vllt jemand helfen??


Code: Alles auswählen
Python 3.3.0 (default, Sep 25 2013, 19:28:08)
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> eingabe = input('Bitte eine Zahl eingeben: ')
Bitte eine Zahl eingeben: 42
>>> eingabe
'42'
>>> type(eingabe)
<class 'str'>
>>> eingabe * eingabe
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can't multiply sequence by non-int of type 'str'
>>> eingabe * 3.14
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can't multiply sequence by non-int of type 'float'Code: Alles auswählen
>>> 'x' * 5
'xxxxx'
>>> ['x'] * 5
['x', 'x', 'x', 'x', 'x']
>>> ['x'] * 5.0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can't multiply sequence by non-int of type 'float'Code: Alles auswählen
from math import pi
print ("Dieses Programm dient dem Berechnen von Volumen und Oberflaeche verschiedener Koerper und Flaechen!")
print (" a = Die Oberflaeche A einer Kugel, mit Radius r")
print (" b = Das Volumen V einer Kugel, mit Radius r")
print (" c = Das Volumen V fuer einen Kegel, mit Hoehe h und Radius r")
print (" d = Die Laenge s einer Mantellinie eines Kegels, mit Hoehe h und Radius r")
print (" e = Das Volumen V fuer einen Kegelstumpf mit Hoehe h, Deckflaechenradius r und Grundflaechenradius R")
I = input ("Bitte waehlen Sie was Sie berechnen moechten: ")
a = 1
b = 2
if I == 1:
print ("klappt")
elif I == 2:
print ("klappt2")