Hackerearth's python problems solutions( Jadoo vs Koba, Jadoo and DNA Transcription, Jadoo Hates Numbers, 13 Reasons Why, Chacha!! O Chacha ) :
Problem 1: Jadoo vs Koba
Solution: (in python 3.8)
( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder)
ord() function returns the ASCII value of a character inside it's parenthesis. You can also wrap up this question in one line using list comprehensions:
Problem 2: Jadoo and DNA Transcription
Solution: (in python 3.8)
( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder)
The print function signature is:
print(*object , sep = ' ' , end = '\n' , file = sys.stdout , flush = False)
here sep means how you want to seperate the variables , by default its value is a single space.
For example -
a = 12
b = 34
print(a,b) # 12 34
print(a,b,sep="|") # 12|34
print(a,b,sep="") # 1234
In the function end means how you want to end your print statement , by default its value is \n i.e next line. Continuing the above example:
print(a)
print(b) # 12
34
print(a , end=" ")
print(b) # 12 34
In this way you can use sep and end in the print function.
Problem 3: Jadoo Hates Numbers
Solution: (in python 3.8)
( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder)
This code is simple. There's no need for any explanation.
Problem 4: 13 Reasons Why
Solution: (in python 3.8)
( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder)
This code is simple. There's no need for any explanation.
Problem 5: Chacha!! O Chacha
Solution: (in python 3.8)
( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder)
Explanation: since chacha doesn't like to download the movies , he automated the task. To prevent use of automation captcha is used. Like you have seen sometimes you have to enter what's written in the image containing twisted or blurry letters. This is done to check you are not a bot. Since bots can't understand these things.
how to submit: click the submit button directly , don't click compile and test.
Guys, if you have any queries related to a question or need more explanation for a question , comment below!
Moreover, i can suggest you best blogging website for latest technologies/products/services update.
Comments
Post a Comment