Posts Day00 - Hello, World (Python 3)
Post
Cancel

Day00 - Hello, World (Python 3)

  • URL : https://www.hackerrank.com/challenges/30-hello-world/problem

  • Objective
    • In this challenge, we review some basic concepts that will get you started with this series. You will need to use the same (or similar) syntax to read input and write output in challenges throughout HackerRank. Check out the Tutorial tab for learning materials and an instructional video!
  • Task
    • To complete this challenge, you must save a line of input from stdin to a variable, print Hello, World. on a single line, and finally print the value of your variable on a second line.
  • You’ve got this!

    • Note: The instructions are Java-based, but we support submissions in many popular languages. You can switch languages using the drop-down menu above your editor, and the inputstring variable may be written differently depending on the best-practice conventions of your submission language.
  • Input Format

    • A single line of text denoting inputstring(the variable whose contents must be printed).
  • Output Format

    • Print Hello, World. on the first line, and the contents of inputstring on the second line.
1
2
3
4
5
6
7
# Read a full line of input from stdin and save it to our dynamically typed variable, input_string.
input_string = input()

# Print a string literal saying "Hello, World." to stdout.
print('Hello, World.')
# TODO: Write a line of code here that prints the contents of input_string to stdout.
print(input_string)
1
2
3
4
hi

Hello, World.
hi
This post is licensed under CC BY 4.0 by the author.