I get in put with input() function like this:
x = input("what do you want to ask")
This is when you have to make the programmer write down something.
in python 3 basic input and output are achieved withstring = input("prompt>")andprint("something")In python 2 you havestring = raw_input("prompt>")andprint "something"
It means that python will print(or write out) a value you input.
"print" will output a value onto the screen for a user to see. "input" or "raw_input" gets a user's input.
it depends what type of program you wish to write. python is a very simple programing langauge therefore it doesnt have much room to play with. i mainly use it to work out simple math problems, or use it to calculate thing for games i play, Ex.) This is a program i wrote to work out the Pythagorean therom to find side "C": a = input("Enter Corner Side A\n ") b = input("Enter Corner Side B\n ") c = a*a+b*b import math print math.sqrt(c) raw_input("Press <enter> To Leave Program") input mean that's where you enter your variable, raw input is what you put at the end so it doesnt just run away (NOTE*** THIS IS A PYTHON 2.6.5 SCRIPT, IT WILL NOT WORK ON OTHER VERSIONS OF PYTHON" notice i put ("Press <enter> To Leave Program") this is what it will say before it "runs away". i suggest watching some youtube videos on how to write programs for your version of python. also try using the manual that comes with your version of python. it helps greatly.
1.>>> x=input("enter data: ")2.enter data: 253.>>> type(x)4.5.>>> y = int(x)6.>>> type(y)7.I used Python 3.0 for this.Else for earlier version, to accept string type input, u should be using "raw_input" instead of "input" only.I made python accept a data and tested its type, which return to be a string (line 4).Then I usedint()to convert the string into a number, which, for testing purpose, I assigned the value to a variable y. (line 5)Testing the type of data that variable y stores, confirms that the string type was converted to an integer type.(line 7)
in python 3 basic input and output are achieved withstring = input("prompt>")andprint("something")In python 2 you havestring = raw_input("prompt>")andprint "something"
It means that python will print(or write out) a value you input.
"print" will output a value onto the screen for a user to see. "input" or "raw_input" gets a user's input.
In which computer language?
integer = input("Please input an integer greater than 0: ") print(integer)
1. Input is received. 2. Some process is performed on the input. 3. Output is produced. Source: Starting out with Python by: Tony Gaddis
it depends what type of program you wish to write. python is a very simple programing langauge therefore it doesnt have much room to play with. i mainly use it to work out simple math problems, or use it to calculate thing for games i play, Ex.) This is a program i wrote to work out the Pythagorean therom to find side "C": a = input("Enter Corner Side A\n ") b = input("Enter Corner Side B\n ") c = a*a+b*b import math print math.sqrt(c) raw_input("Press <enter> To Leave Program") input mean that's where you enter your variable, raw input is what you put at the end so it doesnt just run away (NOTE*** THIS IS A PYTHON 2.6.5 SCRIPT, IT WILL NOT WORK ON OTHER VERSIONS OF PYTHON" notice i put ("Press <enter> To Leave Program") this is what it will say before it "runs away". i suggest watching some youtube videos on how to write programs for your version of python. also try using the manual that comes with your version of python. it helps greatly.
There are several ways. First, Blender's user interface was written in Python, and most of the commands and menus are actually Python functions. Blender actually contains the Python interpreter, and uses it extensively. Go to the Scripting view, and you'll see an interactive console. The python version exposed is based on your Blender version, but you'll typically see Python 3.? for newer versions of Blender. You can interact with Python in command-line mode here as with any Python interpreter. The scripting view also contains a text editor optimized for Python coding. Turn on syntax highlighting and choose from the Templates menu to see a number of interesting Python scripts. Most of these scripts can be run directly to control Blender through the command interface. This allows you to build automated scenes through program code. Finally, you can use a Python script as a controller in the game engine. This accepts input from sensors and passes output to actuators. However, your code can manipulate input and output any way you want, turning the Blender game engine into a full-blown 3D game development toolkit.
Python programming allows you to write your own programs. For example, to write a function named double that returns the number that you input, but doubled, we would write the following (where >>>> indicates a tab space) def double(x): >>>>x=x*2 >>>>return x
Reticulated Python
In a python
a python