3

I'am new to the Julia language and below is a code that I encode using the Jupyter Notebook, but there is no output but when i tried the same code using the REPL, there is an output. Please help me with this.

NOTE: the value of the variable is set to either 'S' or 's' and the input is a function that i copied from Ismael Venegas Castelló (Julia request user input from script). Thank you by the way Mr. Castelló.

if choose == 'S' || choose == 's'

    str = input("Please input a String.");

    che = input("please input a character to be search");

    search(str, che);

end
Community
  • 1
  • 1
Dame
  • 31
  • 1
  • 2
  • 3
    What is the error that you're getting? The `input` works fine for me in both Jupyter and REPL. Can you provide a fully reproducible example? – niczky12 Apr 25 '17 at 11:52

1 Answers1

2

Worked totally fine for me this way in JuliaPro(0.5.1.1).

julia> choose='s'
's'

julia> function input(prompt::AbstractString="")
              print(prompt)
              return chomp(readline())
          end
input (generic function with 2 methods)

julia> if choose == 'S' || choose == 's'
           str = input("Please input a String.");
           che = input("please input a character to be search");
           search(str, che);
       end
Please input a String.It is working.
please input a character to be searchk
10:10
ramk15
  • 21
  • 2