Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- offerte = []
- altre_offerte = True
- while altre_offerte:
- offerta = input("Inserisci l'offerta prevenuta(0 per terminare)")
- try:
- offerta=float(offerta)
- except ValueError:
- print("Formato non valido")
- continue
- if offerta == 0:
- altre_offerte = False
- continue
- if offerta < 0:
- print("non possono essere fatte offerte negative!")
- continue
- email = input("Inserisci l'email del offerente")
- if not (re.match("^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$", email)):
- print("Email non valida, riprova..")
- continue
- offerte.append([email, offerta])
- print(offerte)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement