#user_input_examples.py
import random
import sys
import os

#prompt the user to enter something:
print("Enter your name and press ENTER key :", end="")

#get value from user
name = sys.stdin.readline()

print ("\n","Hello ",name)

#note:   The readline() function creates a string with a trailing "\n"
#        This means that the name variable is a string ending in "\n"
#        when you print "name" there will be two blank lines after it
#        when you use:  print(name, end="")  there will stil be a new line

print(name)
print(name,end="")
print("next line")

print("\n")

#to remove the trailing "\n",  use rstrip()
name = name.rstrip()
#the trailing "\n" is now gone


print(name)
print(name,end="")
print("next line")

#to understand this better type in the follwoing lines at the Idle >>> prompt,
# without the leading #

#name = sys.stdin.readline()
#name

#you anc see the "/n" in the string.
#now type in the next two lines without the leading #

#name = name.rstrip()
#name
