Skip to content

Commit

Permalink
[SOLVED] stringFormatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sakib412 committed Nov 17, 2021
1 parent f9346ad commit 104d2a7
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions hackerrank/stringFormatting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# https://www.hackerrank.com/challenges/python-string-formatting/problem

def decimal_to_octal(digit):
octals = list()
type(octals)
while(digit != 0):
remainder = digit%8
octals = octals.append("hello")
digit = int(digit/8)
return octals



def print_formatted(number):
for i in range(number):
if i < 100:
continue
octal = decimal_to_octal(i+1)
print(f"{i+1} {octal}")


if __name__ == '__main__':
n = int(input())
# print_formatted(n)
print(decimal_to_octal(n))

0 comments on commit 104d2a7

Please sign in to comment.