Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/convert_to_binary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Write a program that given a number as input convert it in binary.
#
# Output:
# Insert first number: 8
# The binary number is: 1000
#

n = int(input("Insert first number: "))
print("The binary number is: ", bin(n)[2:])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

puoi fare il wrap del codice in una funzione

quindi crea una funzione che implementi questo codice



Loading