#23 : String Formatting | Hackerrank Python Solution

preview_player
Показать описание
Thanks if u r Watching us....
#Python #Dev19 #HackerankSolutions #C #C++ #Java #Python #C
Please Subscribe Us ....
Рекомендации по теме
Комментарии
Автор

Thanks I'm watching this series from lecture 1 and reached till here will complete whole series very soon
❤❤

alishakumari
Автор

You are great at explaining codes.THANK YOU SO MUCH .

isshasethi
Автор

keep posting on like this cause its so easy to understand and it will be so helpful to a lot of beginners and intermediate ones...thank you!!

muralikrishna
Автор

def print_formatted(number):
width = len("{0:b}".format(number))

# Iterate from 1 to the given number
for i in range(1, number + 1):
# Print the number in decimal, octal, hexadecimal (uppercase), and binary formats
print("{0:{width}d} {0:{width}o} {0:{width}X} {0:{width}b}".format(i, width=width))
if __name__ == '__main__':
n = int(input())
print_formatted(n) USE X I IN UPPER CASE THAT CAUSES ERROR IN SUBMISSION PROCESS

ridayefatima-wi
Автор

The content is good but would you mind to explain everything in English, please? I struggled and doubted myself awhile until I recognise that it’s the language barrier instead of my coding knowledge. Keep it up & thank for your content!

bachlam
Автор

any idea why this does not work

def print_formatted(number):
width = len(bin(number)[2:])
for i in range(1, number+1):


aishwary
Автор

bro thoda jor se bolo kuch sunai nahi dera

sahilapte
Автор

Loved the video bro thank you :D! Just had a doubt about how I could use f"{}" instead of .format method.

aaditshah
Автор

It's run but does not submit ... produce test case error

Programming-Ninjas
visit shbcf.ru