answersLogoWhite

0

try using this code:

import pygame

def main():

(tab)screen = pygame.display.set_mode((750,750))

(tab)pygame.display.set_caption("graph")

(tab)screen.fill((255,255,255))

(tab)pygame.draw.line(screen, (0, 0, 0), (375, 0), (375, 750))

(tab)pygame.draw.line(screen, (0, 0, 0), (0, 375), (750, 375))

(tab)pygame.display.flip()

(tab)while True:

(tab)(tab)x = raw_input("x: ")

(tab)(tab)if x 'q':

(tab)(tab)(tab)pygame.quit()

(tab)(tab)(tab)break

(tab)(tab)print ''

(tab)(tab)screen.fill((255,255,255))

(tab)(tab)pygame.draw.line(screen, (0, 0, 0), (375, 0), (375, 750))

(tab)(tab)pygame.draw.line(screen, (0, 0, 0), (0, 375), (750, 375))

(tab)(tab)try:

(tab)(tab)(tab)pygame.draw.circle(screen, (0, 0, 255), (int(x) + 375, -1 * int(y) + 375), 3 )

(tab)(tab)except:

(tab)(tab)(tab)print "graph error, please enter valid x,y coordinates"

(tab)(tab)pygame.display.flip()

main()

pygame.quit()

this code makes a simple grapher.unfortunitly when I typed this answer, the tabs don't show up so I had to do this instead. any time it says "(tab)" just insert a tab there instead.

User Avatar

Wiki User

∙ 15y ago
User Avatar

What else can I help you with?

Continue Learning about Engineering

What is python 2.5.1?

Python is a scripting language. Which you can use to make games, gui apps, text based apps or anything you want. Python comes "with batteries included" which means that the standard library contains a lot, for many different things.


What is pythan language?

Python Language: Python is a widely-used programming language that was created by Guido van Rossum and first released in 1991. It is known for its clear and concise syntax, making it easy to learn and write code in. Python is an interpreted language, which means it does not require compilation before running, making it highly accessible for beginners. It is open-source and has a vast standard library and a large community, contributing to its popularity. Python is used for a wide range of applications, including web development, data science, machine learning, scientific computing, automation, and more. If you are interested in learning more about Python or gaining expertise in this language, "Achieversit" can provide training and resources to help you excel in your Python programming journey.


Is there any way I can make Python 3.4.3 do one thing if a number is greater than 10 and another if it is less?

As in any programming language use an "if" statement.


What is the Python programming language?

In the context of computer programming, Python is an open source programming language. I put some links that I found helpful when learning Python on my webpage: http://www.homeworkcat.com


What is optional for python programming?

One optional part of python programming is the declaration of variables before use. In many languages, you must declare your variables before using them, but in python, you can simply set a variable equal to something and it will handle the type without your help.

Related Questions

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.


What is the best python book?

If you're new to programming, try the How to Think like a Computer Scientist book (make sure you get the Python version!)If you're already a pro and are just learning a new language, Dive into Python is great and it's free online. Also, Core Python Programming by Wesley Chun is great, but it's not free.


Which programming language should I learn JavaScript or Python?

Javascript is more easier, while Python is more complex. So, maybe you should try Javascript.


What is python 2.5.1?

Python is a scripting language. Which you can use to make games, gui apps, text based apps or anything you want. Python comes "with batteries included" which means that the standard library contains a lot, for many different things.


what is the scope of python programmer in kochi?

Python is one of the best and simplest programming language used world wide. learning python from a best python training institute in Kochi will make you skilled in this language and you can find many opportunities in Kochi and abroad. Python programmers are needed in many tech sectors. Therefore python programmers demand will be on the rise. Learning python is of good choice.


What programming language use to make website?

Lots of programming languages are used to make websites. Some common ones are PHP, Python, and Ruby, but there's nothing ... except common sense ... stopping you from coding a website in COBOL if you really want to.


What is pythan language?

Python Language: Python is a widely-used programming language that was created by Guido van Rossum and first released in 1991. It is known for its clear and concise syntax, making it easy to learn and write code in. Python is an interpreted language, which means it does not require compilation before running, making it highly accessible for beginners. It is open-source and has a vast standard library and a large community, contributing to its popularity. Python is used for a wide range of applications, including web development, data science, machine learning, scientific computing, automation, and more. If you are interested in learning more about Python or gaining expertise in this language, "Achieversit" can provide training and resources to help you excel in your Python programming journey.


Is Python hard to learn?

It is the one of the easiest programming language to learn. -Python is beginner friendly language -If you are interest to start programming to learn Python is one of the easiest programming language. -It is easy to learn,easy to write,easy to understand. -So python is not hard to learn it is very easy to learn.


What can people do using Microsoft Excel?

Microsoft Excel is a spreadsheet program used to make charts containing information. You can make calculations. use graphing tools, and pivot tables. On this program you can enter, analyze, and present data in a organized way.


Is there any way I can make Python 3.4.3 do one thing if a number is greater than 10 and another if it is less?

As in any programming language use an "if" statement.


How do you make a app using the python programming language and not using py2app?

Py2app for the Mac, or Py2exe for Windows, create a standalone executable file from a Python program, which can run without the Python interpreter. You can always run the application within the Python interpreter. If you want to create an executable file, Python includes no built-in tools to do this; you need an application such as Py2app or Py2exe. Of course, you might search for alternative tools, that do the same thing.


What is the Python programming language?

In the context of computer programming, Python is an open source programming language. I put some links that I found helpful when learning Python on my webpage: http://www.homeworkcat.com