0

Say I define a function with a parameter of (x). Is it possible to use input provided by the user, saved into a variable (x), that is used as the parameter of the function?

2
  • Can you provide an example of usage please? Commented Mar 3, 2017 at 12:33
  • marked as duplicate, ping me if you heavily edit your question I'll reopen otherwise you have you answer in the link. Commented Mar 3, 2017 at 12:38

1 Answer 1

0

If you're using Python2 try raw_input method:

x=raw_input("please input a string")

Or in Python3 try input method:

x=input("please input a string")
Sign up to request clarification or add additional context in comments.

3 Comments

I don't think this is what the OP wanted, but maybe I'm wrong. Also, please at least provide a link to usage instruction, or add an explanation your self.
if that's what the user wants, then the duplicate link is enough.
@Jean-FrançoisFabre That's right

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.