اكتب برنامج لتحويل الرقم الثنائى إلى رقم عشري
- برمجة
- برمجة بايثون
- 2021-04-13
- daafoor
الأجوبة
b_num = list(input("Input a binary number: "))
value = 0
for i in range(len(b_num)):
digit = b_num.pop()
if digit == '1':
value = value + pow(2, i)
print("The decimal value of the number is", value)
الناتج المتوقع
Input a binary number: 1000001
The decimal value of the number is 65القوائم الدراسية التي ينتمي لها السؤال