We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 716a19c commit 9b25970Copy full SHA for 9b25970
binary_to_decimal.py
@@ -0,0 +1,7 @@
1
+def bin_to_dec(n:int)->int:
2
+ return int(str(n),2)
3
+
4
5
6
+num = int(input('Enter a number (base 2): '))
7
+print("It's value in base 10 is",bin_to_dec(num))
0 commit comments