能有人請解釋Python程序的這些行對我來說:二進制到十進制和十進制到二進制轉換器
b =input("What number would you like to convert into Binary? ")
convert = lambda d: bin(int(d)) [2:]
print(b + " is " + convert(b) + " in Binary")
而且還幾行代碼:
b = input("What Binary number would you like to convert into Decimal? ")
convert= lambda b: str(int(b, 2))
print(b + " is " + convert(b) + " in Decimal")
哪一部分你不聯合derstand? lambda表達式? –
對於那些(像我)想知道什麼在地球上denary意味着:大多數人稱這個數字系統十進制(即,基數10):) – fvu
FWIW,我編輯了標題,並改變了denary/dinery到十進制。 – Macke