Number to Binary Conversion in Python
If you have a decimal number, and want to get it’s binary value, you can use the built-in bin
method.
decimal = 32
binary = bin(decimal)
# …
Read Article →
403 articles about python development, tools, and best practices
If you have a decimal number, and want to get it’s binary value, you can use the built-in bin
method.
decimal = 32
binary = bin(decimal)
# …
Read Article →
A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the …
Read Article →Given a non-negative integer, return an array / a list of the individual digits in order.
Examples:
123 => [1,2,3]
1 => [1] …
Read Article →
Create a Circular List
A circular list is of finite size, but can infititely be asked for its previous and next elements. This is …
Read Article →Don Drumphet lives in a nice neighborhood, but one of his neighbors has started to let his house go. Don Drumphet wants to build a wall …
Read Article →Given two integer arrays where the second array is a shuffled duplicate of the first array with one element missing, find the missing …
Read Article →Remove a exclamation mark from the end of string. You can assume that the input data is always a string, no need to verify it.
Create a function close_compare
that accepts 3 parameters: a
, b
, and an optional margin
. The function should return whether a
is lower …
You’re re-designing a blog and the blog’s posts have the following format for showing the date and time a post was made: …
Read Article →Create a method that accepts a list and an item, and returns true
if the item belongs to the list, otherwise false
.
list = …
Read Article →
Create a function called shortcut
to remove all the lowercase vowels in a given string.
shortcut("codewars") # --> …
Read Article →
In this tutorial, you will learn how to sort a list in Python, by following the below three steps: