Permitir que o software para introduzir dados por dois usuários, mas não se repita

Exemplos de código

1
0

python verifique se input() dá erro

try:
    # Note: Python 2.x users should use raw_input, the equivalent of 3.x's input
    age = int(input("Please enter your age: "))
except ValueError:
    print("Sorry, I didn't understand that.")
else:
	if age >= 18: 
    	print("You are able to vote in the United States!")
	else:
    	print("You are not able to vote in the United States.")
0
0

python verifique se pretende executar funtion

age = sanitised_input("Enter your age: ", int, 1, 101)
answer = sanitised_input("Enter your answer: ", str.lower, range_=('a', 'b', 'c', 'd'))

Em outros idiomas

Esta página está em outros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................