The bigger number
Trang này cần trình duyệt gần đây (hỗ trợ SharedArrayBuffer). Vui lòng cập nhật Chrome, Edge, Firefox hoặc Safari lên phiên bản mới nhất.
Bài này dựa trên một bài học bạn chưa hoàn thành. Hãy làm bài đó trước:
Python Cơ bản · Ra quyết định →
English
The bigger number
Read two whole numbers a and b, one per line, with int(input()) (for example 8 and 15). Store the bigger one in biggest and print it. If they are equal, print equal instead.
A branch can set a variable, not only print. Give biggest a value on every path that prints it, or one path leaves it undefined and Python says NameError. Test the tie first: max alone cannot tell you that the two numbers were equal.
Độ khó 1/5 · 100 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Read two whole numbers a and b, one per line, with int(input()). Store the bigger one in biggest and print it. If they are equal, print equal instead.
Nhấn Chạy để xem kết quả ở đây.