[ Python ] Làm cách nào tôi có thể đọc đầu vào dưới dạng số?

Info Dark
0 comments 160 views

lq.viet90

Posted at March 16, 2022, 4:58 p.m.

0

Tại sao x và y string thay vì int trong đoạn code dưới đây?

play = True
while play:

x = input("Enter a number: ")

y = input("Enter a number: ")


print(x + y)

print(x - y)

print(x * y)

print(x / y)

print(x % y)


if input("Play again? ") == "no":

play = False



0 answers