PRP201c_-_SP_2022_-_Block5_-_PE_131.webp
Kim Anh1

PRP201c_-_SP_2022_-_Block5_-_PE_131.webp

  • Media owner Kim Anh1
  • Ngày thêm
Practical exam 01: 120 minutes
1. (3 points) Write a program that repeatedly prompts a user for numbers until the user enters a positive interger number. Once a valid number is entered, the program converts the number into a binary number and print out the result. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number. For example, enter -1 and 10 and match the output below.
Enter a positive integer number: -1
The number must be positive.
Enter a positive integer number: 12
12 is converted into binary: 1100
Chưa có bình luận nào.

Thông tin

Category
PRP201c
Thêm bởi
Kim Anh1
Ngày thêm
Lượt xem
918
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom