HackerRank:- Print function Discussions

Q:-  The included code stub will read an integer, , from STDIN.

Without using any string methods, try to print the following:

Note that "" represents the consecutive values in between.



solutions:-

nint(input("enter a number"))
for i in range (n):
  print(i+1,end="")

here the end = ' ' will take next iteration as the argument and print it in the same line.






Comments

Popular posts from this blog

XAMPP, SQL BASIC COMMANDS

The Minion Game Hackerrank Solution

Arrays - DS | HackerRank Solutions