Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __author__ = 'Leonardo'
- import math
- valore= False
- i=input("Inserire una stringa:")
- n=0
- a=0
- while not valore:
- if len(i)>n:
- a=a+ord((i[n]))
- print("Carattere analizzato",i[n])
- n=n+1
- print("Somma parziale:",a)
- if a>500:
- print ("NUMERO MAGGIORE DI 500, STOP")
- valore= True
- elif len(i)==n:
- print ("STRINGA TERMINATA:",a)
- valore= True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement