Advertisement
Maszi

str 29 [klasyczne] zad.2

Dec 1st, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. n = int(input("Podaj ilość liczb: "))
  2. suma = 0
  3. licznik = 0
  4. while licznik < n:
  5.     liczba = int(input("Podaj liczbę: "))
  6.     if 10 < liczba < 50:
  7.         suma += liczba * liczba
  8.     licznik += 1
  9. print("Suma kwadratów podanych liczb to: " + str(suma))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement