Python: Logical Operator "and"

Post Reply
User avatar
Jason
Site Admin
Posts: 973
Joined: Sun Dec 21, 2025 8:56 pm
Contact:

Code: Select all

print(Let's choose two positive numbers under 4, in a certain order I had in mind.")

try:

	first_choice_for_number = int(input("Choose the first number.:"))

	second_choice_for_number = int(input("Choose the second number:"))
	
except ValueError: 

	return "Sorry, what is entered must be integers."
	
else:

	if(first_choice for number == 3 and second_choice_for_number == 2):

		print("You chose the correct ones in the
		correct order of 3 and then 2.")
		
	else

	print("Sorry, you missed the correct ones in the correct order.")

 

POSTREACT(ions) SUMMARY

Post Reply