The function input() takes in an input from the command line. For example, if you input prince into the command line, now the variable val has a value of "prince".
With the for loop, you are using the for-each notation. Strings are also a type of iterator--in fact, strings are simply arrays of characters. Think of it like a regular list, but instead of having a list like [1, 2, 3, 4], you have the list ['p', 'r', 'i', 'n', 'c', 'e']. So each iteration of the for loop only prints the character it is currently iterating on.
You could simplify your code by avoiding the for loop and only using the code print("Hello", val).
However, if you only want to practice with for loops, you can use the code below. Try to understand how and why you can simplify it!
val = input() //stores the user input into val
name = "" //creates an empty string called name
for s in val: //iterates through each character in val
name += s //adds that character to name
//when the for loop ends, the user input is stored in name
print("Hello", name) //prints "Hello" and the name
forloop? Don't you just wantprint("Hello", val)?