Sorry, I'm not doing your homework for you.
I suggest you flowchart the problem, execute it yourself by hand on the flowchart a few times to make sure it works, then convert the flowchart to code in whatever language the teacher told you to use.
That's what I did back in 1973 with my program to play tic-tac-toe, that I had to punch on cards using the FORTRAN II programming language when I first started on computers. Hand execution of a program though tedious and boring is a very effective means to find bugs and gain insight to the way computers operate.
What type of software is python?
Who created the Python programming language?
#LMGTFY
Guido van Rossum, a Dutch computer programmer is the author of the programming language Python. Among Python programmers and the Python community, van Rossum us known as the "Benevolent Dictator For Life" (BDFL).
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.
Any good teaching sites for Python?
Codecademy offers a python course which works pretty well. That's how I learned!
The Official Python Tutorial
*Maybe* you could start there?
Python for non-programmers is a LIST OF TUTORIALS
Invent Your Own Computer Games With Python
I used it a lot, even though it's called '... computer games ...' it teaches you a lot of the basics in a fun, simple way.
Sthurlow is a great beginners tutorial too.
Help:
StackOverflow is for programming related questions
The official Python IRC channel is very good
I would add websites like
Udemy
Coursera are very good.
Also you can rely on tutorials by
Tutorialspoint where you get answered for all your queries.
Are applescript and python the same?
There both programming languages if that's what you mean but they're different in how they are implemented. Python is a general-purpose language compatible with almost any OS but Applescript is designed for Macintosh and apple products.
Do python identifiers have to start with a letter or underscore?
Yes, that's the rule in Python (and in many other programming languages, as well).
How do you import random in python 3.2?
import random
random.randrange(1, 99999) #Set range from 1 to 99999
Where can one obtain a Python list?
Python lists can't be downloaded from an adress or website source. They have to be created in the Python programming language. Lists can then be created by using a text editor.
How can you create infinite instances of the same class using Python?
try using a never ending looping statement
(I know that I need a while/for loop, but I don't know how to assign variables to a randomly generated string)
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.
scores = [51, 47, 53, 97, 27]
summation = 0.0
for score in scores:
summation *= score # Semantic Error.
average = summation / len(scores)
print average # Isn't average. average == 0
Does a sentinel variable keep a running total?
It is not common, but possible. (If the list members are numbers.)
Does Python allow programmers to break a statement into multiple lines?
Apparently it does. From an online style guide:
"The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces. Long lines can be broken over multiple lines by wrapping expressions in parentheses. These should be used in preference to using a backslash for line continuation. Make sure to indent the continued line appropriately. The preferred place to break around a binary operator is after the operator, not before it. "
Source: http://www.python.org/dev/peps/pep-0008/#maximum-line-length
What is floor division in Python?
Floor division is division where the answer is rounded down. For example, 5/2 in floor division is not 2.5, but 2. In Python 2, floor division is the default. In Python 3, the floor division operator is //.
Python 2:
>>> 5/2
2
>>> 5.0/2
2.5
Python 3:
>>> 5/2
2.5
>>> 5//2
2
Which python expression finds the value?
It depends... "if" will check to see if a value is equal to something; but there are operators such as "+", "*", "-", "/", etc.
How do you define Y as 1 and N as 0 in Python?
I suspect that you mean that you want to define constants, which is not possible in Python. Any variable can be rebound to something else at any time.