Skip to content
Snippets Groups Projects
Commit 9cf297f8 authored by pasi kanto's avatar pasi kanto
Browse files

tehtävät

parent 5d8e03ad
No related branches found
No related tags found
No related merge requests found
summa = 0
luku = 0
while True:
x= input("Anna luku: ")
if x.isdigit():
x=int(x)
summa = summa + x
luku = luku+1
else:
break
print (luku)
print("lukujen summa on ")
print (summa)
\ No newline at end of file
tyhja=[]
luku=0
while True:
nimi=input("Kerro nimesi")
if nimi !="":
tyhja.append(nimi)
luku = luku+1
else:
break
tyhja.sort()
print(tyhja)
print("nimien määrä ", luku)
\ No newline at end of file
tyhja=[]
luku=0
while True:
nimi=input("Kerro nimesi")
if nimi !="":
tyhja.append(nimi)
luku = luku+1
else:
break
print(tyhja)
print("nimien määrä ", luku)
\ No newline at end of file
import random
luku=0
tyhja =[]
while luku <8:
x = random.randint(1,41)
tyhja.append(x)
luku =+1
print(tyhja)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment