answersLogoWhite

0

How do you get input in python?

Updated: 8/10/2023
User Avatar

ARMANS

Lvl 1
9y ago

Best Answer

I get in put with input() function like this:

x = input("what do you want to ask")

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

This is when you have to make the programmer write down something.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you get input in python?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How input and output is achived in python programming?

in python 3 basic input and output are achieved withstring = input("prompt>")andprint("something")In python 2 you havestring = raw_input("prompt>")andprint "something"


What is the purpose of print strings in python?

It means that python will print(or write out) a value you input.


What is the meaning of print and input in idle python?

"print" will output a value onto the screen for a user to see. "input" or "raw_input" gets a user's input.


How do you write the code by python?

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.


How do I convert a string to an integer in python?

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)

Related questions

How input and output is achived in python programming?

in python 3 basic input and output are achieved withstring = input("prompt>")andprint("something")In python 2 you havestring = raw_input("prompt>")andprint "something"


What is the purpose of print strings in python?

It means that python will print(or write out) a value you input.


What is the meaning of print and input in idle python?

"print" will output a value onto the screen for a user to see. "input" or "raw_input" gets a user's input.


How do you write a program to input radius of a circle and calculate the area or circumferences of the cirlce?

In which computer language?


Write a line of code that asks the python user to input an integer greater than 0 and store this value in a variable and display its value?

integer = input("Please input an integer greater than 0: ") print(integer)


Computer programs perform what three steps?

1. Input is received. 2. Some process is performed on the input. 3. Output is produced. Source: Starting out with Python by: Tony Gaddis


How do you write the code by python?

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.


How do you use Blender with Python?

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.


What is meant by functions on python?

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


What is a Python that starts with the letter R?

Reticulated Python


How a python reproduces?

In a python


What is a boa or a python?

a python