Skip to content
Snippets Groups Projects
Commit f4c32022 authored by Viivi Röntynen's avatar Viivi Röntynen
Browse files

Upload New File

parent 389fec62
No related branches found
No related tags found
No related merge requests found
luku=0
print(f"Luku on {luku}.")
while True:
input1=(input("Anna operaatio (tyhjä lopettaa): "))
if input1=="":
print("Kiitos ja moi!")
break
elif input1.find("-")!=-1:
luku-=int(input1[1:])
print(f"Luku on {round(luku)}.")
elif input1.find("+")!=-1:
luku+=int(input1[1:])
print(f"Luku on {round(luku)}.")
elif input1.find("*")!=-1:
luku*=int(input1[1:])
print(f"Luku on {round(luku)}.")
elif input1.find("/")!=-1:
luku/=int(input1[1:])
print(f"Luku on {round(luku)}.")
\ 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