answersLogoWhite

0

How do you write the code by python?

Updated: 8/11/2023
User Avatar

JingyaoZhanggp2659

Lvl 1
8y ago

Best Answer

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.

User Avatar

Wiki User

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

Wiki User

8y ago

Python is a fairly easy and powerful programming language, you need to learn the language and then you can start writing codes and programs,

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write the code by python?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which one of the following was one of guido van rossum's goals for python?

One of Guido van Rossum's goals for Python was to create a language that was easy to read and write, emphasizing code readability and simplicity.


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


Is python 2.2 a antivirus software?

Python is a programming language, it is used to make computer programs. so you could write an antivirus using python.


Can you delete code on python?

you can uninstall it just like any other program.


Write converter currency code in python language?

If you're looking for a currency converter or information on how to use them,the following is the best resource that i have found online: http://www.fxconverter.org.


What is the python code for drawing a circle?

circle(radius)


What years did Douglas Adams write for Monty Python?

i dont think he was actually a hired writer for monty python. i believe he just helped write with them. check wikipedia.


What is the purpose of print strings in python?

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


What did Ruskin Bond write in his conceited python?

he was nature lover


Is python required on a computer?

Python is in no way required on a Microsoft or Apple operating system. Python is a programming language/interpreter and is just an addon. Python, a computational language, like Java/C++, is not required to operate a computer. It is solely a shell and language combination that programmers might use to write code/ algorithms in a simpler language than Java. You do not need it unless you want to use for coding or learning computational function construction. Your computer will not be affected by whether or not you have Python, (the latest version is 3.0).


Is there anyone that knows a lot about a ball python pls write back FAST?

You mean a Royal python - from it's assigned Latin name of Python regius - Drop me an email through my profile - and I'll answer soon as I get it.


why python is simple?

-It is a high-level and interpreted programming language. -Python is a general-purpose language. -It has a simplified syntax nature. -It is easy to understand. -It is easy to read and write. -Python is much faster than other languages.