small program stops - why?
<p>Whats wrong with my code? 
After the second "input" the program stops...</p>

<pre><code>convr = 0

x = input("Inform value: ")
y = input("Inform if is Dolar (D) or Euro (E): ")

convt = x * convr

if y == "D":
    convr = 1/0.895
    print (convt)
elif y == "E":
    convr = 0.895
    print (convt)
else:
    print ("NOT ALLOWED!")
</code></pre>

<p>Because your <code>x</code> variable is a string, you need to transform it to number, eg. <code>float</code> or <code>int</code>.</p>

<pre><code>x = float(input("Inform value: "))
y = input("Inform if is Dolar (D) or Euro (E): ")

if y == "D":
    convr = 1/0.895
    convt = x * convr
    print (convt)
elif y == "E":
    convr = 0.895
    convt = x * convr
    print (convt)
else:
    print ("NOT ALLOWED!")
---------
# Inform value: 2345
# Inform if is Dolar (D) or Euro (E): D
# 2620.1117318435754
</code></pre>

python python-3.x input