50188/is-possible-to-run-function-in-python-using-the-command-line
Suppose your file name is demo.py and it contains the following code
def my_func():
return "Hello, World!"
Now you can run it from command line using following line
$ python -c 'from demo import my_func; print my_func()'
so I was following a class and we were focusing on birthdays and how the computer could get ur age and I wrote
birth_year = input(‘birth year: ‘)
And I said keyboardInterrupt can someone help I don’t know what to do
Hey, @Ella,
Could you please mention particularly which class you were focusing on? Is that any Youtube video or anything else?
Now, regarding your query, you can change:
To
birth_year = input("birth year: ")
I hope this will work.
Good question, glad you brought this up. I ...READ MORE
Hi@Shubham, It may possible. When you saved your ML ...READ MORE
Example of implicit line continuation: a = some_function( ...READ MORE
Every occurence of "foreach" I've seen (PHP, ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
You can simply the built-in function in ...READ MORE
Since I am using Python 3.6, I ...READ MORE
The backslash "\" character is used to ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.