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.
What is the keyword for function(python)?
There are two related concepts, both called "keyword arguments". On the calling side, which is what other commenters have mentioned, you have the ability to specify some function arguments by name. You have to mention them after all of the arguments without names (positional arguments), and there must be default values for any parameters which were not mentioned at all. The other concept is on the function definition side: You can define a function that takes parameters by name -- and you don't even have to specify what those names are. These are pure keyword arguments, and can't be passed positionally. The syntax is def my_function(arg1, arg2, **kwargs) Any keyword arguments you pass into this function will be placed into a dictionary named kwargs. You can examine the keys of this dictionary at run-time, like this: def my_function(**kwargs): print str(kwargs) my_function(a=12, b="abc") {'a': 12, 'b': 'abc'}
What must happen before the while loop will stop iterating?
The while loop will stop iterating if its condition is no longer true when it reaches the end of an iteration, or if it encounters a break statement.