here is my code
def help():
f = input()
print (f)
it works without def and doesn't work with it in place. I tried many different simple codes like this but received no output whenever I used def. I am using VS code.
here is my code
def help():
f = input()
print (f)
it works without def and doesn't work with it in place. I tried many different simple codes like this but received no output whenever I used def. I am using VS code.
Once a function is defined, you have to call it to make something happen.
def help():
f = input()
print (f)
help()
Note that it may still seem like its doing nothing because you don't prompt for data. You'll need to go to the terminal window and enter a string. Better, include a prompt with your input so you know what to do.
def help():
f = input("Input data to print: ")
print (f)
help()
You are defining the function but never calling it. You need to define it like
def help():
f = input()
print(f)
help()