answersLogoWhite

0

An example might be:

firstNumber = raw_input("Enter your first number: ")

secondNumber = raw_input("Enter your second number: ")

operatorChoice = raw_input("What do you wish to do with these numbers? ")

if operatorChoice == "-":

subtractSum = firstNumber - secondNumber

print("Here is your result: %s") % (str(subtractSum))

if operatorChoice == "+":

additionSum = firstNumber + secondNumber

print("Here is your result: %s") % (str(additionSum))

That's a basic example.

User Avatar

Wiki User

8y ago

What else can I help you with?

Continue Learning about Engineering

What converts the program into machine code in python?

In Python, the conversion of the program into machine code is primarily handled by the Python interpreter. When you run a Python script, the interpreter first compiles the source code into bytecode, which is a lower-level, platform-independent representation. This bytecode is then executed by the Python Virtual Machine (PVM), which interprets it and converts it into machine code for execution on the host system. Essentially, Python is an interpreted language, meaning it translates code at runtime rather than compiling it directly into machine code before execution.


Can you delete code on python?

you can uninstall it just like any other program.


What mean python IDE?

A Python IDE (Integrated Development Environment) is a software application that provides comprehensive facilities to programmers for software development in Python. It typically includes a code editor, debugging tools, a console, and project management features to streamline the coding process. Popular Python IDEs include PyCharm, Visual Studio Code, and Jupyter Notebook, each offering different features to enhance productivity and ease of use for Python developers.


Why doesn't this Python code do what it's supposed to do - see Discussion?

Ask on Stack Overflow. Wiki Answers is not for pasting code


How do you make a random number using Python?

this is the code for making a random number using python: import random >>>random.randint (1, 10) you can do whatever numbers you want.

Related Questions

What converts the program into machine code in python?

In Python, the conversion of the program into machine code is primarily handled by the Python interpreter. When you run a Python script, the interpreter first compiles the source code into bytecode, which is a lower-level, platform-independent representation. This bytecode is then executed by the Python Virtual Machine (PVM), which interprets it and converts it into machine code for execution on the host system. Essentially, Python is an interpreted language, meaning it translates code at runtime rather than compiling it directly into machine code before execution.


Can you run a python program using code Can you give me the code I need to use in order for it to work I am using codio plz help?

Assuming you only intend executing your code on your own machine and you have some version of Python installed, you can execute a Python script from within your code in the same way you can execute a Python script via the command line: python script.py infile outfile -o


Code to develop a calculator in adobe flex?

here is the code for simple calculator in flex,[Bindable] private var _txt:Object;[Bindable] private var _choos:String;private function satu():void{txtLayar.text = txtLayar.text + '1';}private function dot():void{txtLayar.text = txtLayar.text + '.';}private function dua():void{txtLayar.text = txtLayar.text + '2';}private function tiga():void{txtLayar.text = txtLayar.text + '3';}private function empat():void{txtLayar.text = txtLayar.text + '4';}private function lima():void{txtLayar.text = txtLayar.text + '5';}private function enam():void{txtLayar.text = txtLayar.text + '6';}private function tujuh():void{txtLayar.text = txtLayar.text + '7';}private function lapan():void{txtLayar.text = txtLayar.text + '8';}private function sembilan():void{txtLayar.text = txtLayar.text + '9';}private function noll():void{txtLayar.text = txtLayar.text + '0';}private function clear():void{txtLayar.text = '';}private function sum():void{_txt = txtLayar.text;_choos = '1';txtLayar.text = '';}private function sub():void{_txt = txtLayar.text;_choos = '2';txtLayar.text = '';}private function mul():void{_txt = txtLayar.text;_choos = '3';txtLayar.text = '';}private function div():void{_txt = txtLayar.text;_choos = '4';txtLayar.text = '';}private function hasil():void{var txt2:Number = Number(txtLayar.text);var txt3:Number = Number(_txt);var has:Number;if(_choos=='1'){has = txt3 + txt2;}else if(_choos == '2'){has = txt3 - txt2;}else if(_choos == '3'){has = txt3 * txt2;}else if(_choos == '4'){has = txt3 / txt2;}txtLayar.text = has.toString();}]]>


Can you delete code on python?

you can uninstall it just like any other program.


What is the source code for scientific calculator in c?

What is the source code for scientific calculator in c?Read more: What_is_the_source_code_for_scientific_calculator_in_c


What is the python code for drawing a circle?

circle(radius)


How to use pycharm community edition for python programming?

Creating and Running a Python File in PyCharm Step 1: Create a New Project. On the Welcome screen, select New Project. ... Step 2: Create a New Python Script. If you're greeted by the main.py file when the project opens, you're ready to start coding in Python. ... Step 3: Write Some Python Code. ... Step 4: Run Your Python Code.


What is pep 8?

PEP 8, or Python Enhancement Proposal 8, is a style guide for Python code that provides conventions for writing clean and readable code. It covers various aspects of coding style, including naming conventions, code layout, indentation, and comments. Adhering to PEP 8 helps improve code consistency and maintainability, making it easier for developers to collaborate on Python projects. It is widely accepted as the standard style guide in the Python community.


What Python translator used?

Python code is typically executed using the CPython interpreter, which is the reference implementation of Python written in C. Other popular Python translators include PyPy, known for its Just-In-Time (JIT) compilation for improved performance, and Jython, which allows Python code to run on the Java Virtual Machine (JVM). Additionally, IronPython integrates Python with the .NET framework. Each translator has its unique features and optimizations suited for different use cases.


Download code for scientific calculator in java?

yes


What mean python IDE?

A Python IDE (Integrated Development Environment) is a software application that provides comprehensive facilities to programmers for software development in Python. It typically includes a code editor, debugging tools, a console, and project management features to streamline the coding process. Popular Python IDEs include PyCharm, Visual Studio Code, and Jupyter Notebook, each offering different features to enhance productivity and ease of use for Python developers.


Can you do Python coding on an iPad?

Sorry, but not that I know of. Python is only available on Mac OS or Windows. You would also need a code editor which is only on a PC.