Skip to content
Snippets Groups Projects
Commit c88c1a46 authored by Helmi Puustinen's avatar Helmi Puustinen
Browse files

Delete laskin.py

parent 5818964b
Branches
No related tags found
No related merge requests found
print("Luku on 0.")
edellinen = 0
while True:
operaatio = (input("Anna operaatio (tyhjä lopettaa): "))
if operaatio == "":
break
else:
merkki = operaatio[0]
luku = int(operaatio[1:])
if merkki == "+":
tulos = edellinen + luku
print(tulos)
edellinen = tulos
elif merkki == "-":
tulos = edellinen - luku
print(tulos)
edellinen = tulos
elif merkki == "*":
tulos = edellinen * luku
print (tulos)
edellinen = tulos
elif merkki == "/":
tulos = edellinen / luku
print(tulos)
edellinen = tulos
print("Kiitos ja moi!")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment