while True : #infinite iteration, , A = input ( "Enter A" ), , B = input (" Enter B" ), , if A == "1" and B=="1" :, , print ( " 1" ) # out 1 to the screen, , else: # the code underneath is executed when the if condition is false, , print ( " 0 " ) # out 0 to the screen, , repeat = input ( " repeat? Y/N" ), , if repeat == " Y" :, , continue # this ensures the algorithm loops back, , else : # the code underneath is executed when the if condition is false, , break # this statement breaks from the loop, .

โดย

ลีดเดอร์บอร์ด

สไตล์ภาพ

ตัวเลือก

สลับแม่แบบ

)
คืนค่าการบันทึกอัตโนมัติ: ใช่ไหม