# \[Solved\] Accept Input from a Website (Hackerrank)

**URL:** <https://discourse.julialang.org/t/solved-accept-input-from-a-website-hackerrank/16021>\
**Category:** New to Julia\
**Created:** [October 8, 2018, 2:24pm UTC](https://discourse.julialang.org/t/solved-accept-input-from-a-website-hackerrank/16021 "2018-10-08T14:24:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AtomBear88](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@AtomBear88](https://discourse.julialang.org/u/AtomBear88)\
**Post date:** [October 8, 2018, 2:24pm UTC](https://discourse.julialang.org/t/solved-accept-input-from-a-website-hackerrank/16021/1 "2018-10-08T14:24:15Z")

</div>

Hello,

I’m going through the Hackerrank 30 Days of Code, and have a problem that I couldn’t find the answer to. In the challenges, it often has you accept an input (I’m assuming a text file). My question is, how would you code something simple as print “Hello, World.” and a given input? Below is the code I tried

```julia
## Print "Hello, World."

println("Hello, World.")

## Print Hackerrank input

println(STDIN)

```

This gives an output of “Hello, World.” and apparently nothing else. Since it can process the script and let me know that I have the wrong answer, I’m assuming that it’s something wrong with using STDIN (which, to my knowledge, is for interactive user inputs). I couldn’t find the appropriate function within the documentation. Any advice, or guidance on where to look, would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [October 8, 2018, 2:26pm UTC](https://discourse.julialang.org/t/solved-accept-input-from-a-website-hackerrank/16021/2 "2018-10-08T14:26:27Z")

</div>

Use `readline`.

```julia
julia> answer = readline();
Hello!

julia> answer
"Hello!"

```

---

<div class="post-metadata">

**Author:** ![AtomBear88](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@AtomBear88](https://discourse.julialang.org/u/AtomBear88)\
**Post date:** [October 8, 2018, 2:30pm UTC](https://discourse.julialang.org/t/solved-accept-input-from-a-website-hackerrank/16021/3 "2018-10-08T14:30:42Z")

</div>

Thank you! That did indeed work. Marking the title as solved.
