diff options
author | Santo Cariotti <santo@dcariotti.me> | 2024-05-28 10:29:13 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2024-05-28 10:29:13 +0200 |
commit | f05d888a0b621ca4e99e2b0fb6e23c097006fe41 (patch) | |
tree | eebbb2489144112d3288393e354d19375a0aa088 /progs/a396.py |
Init
Diffstat (limited to 'progs/a396.py')
-rw-r--r-- | progs/a396.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/progs/a396.py b/progs/a396.py new file mode 100644 index 0000000..0d03f17 --- /dev/null +++ b/progs/a396.py @@ -0,0 +1,10 @@ +def decimal_To_Binary(N):
+ B_Number = 0
+ cnt = 0
+ while (N != 0):
+ rem = N % 2
+ c = pow(10,cnt)
+ B_Number += rem*c
+ N //= 2
+ cnt += 1
+ return B_Number
\ No newline at end of file |