Startup:
Startup:
from visual import *
Vectors:
a=vector(1,2,3)
a.x, a.y, a.z
mag(a)
# this line is a comment
Variables:
a = 3 # an integer
b = -2. # a floating-point number
c = vector(0.4, 3e3, -1e1) # a vector
Earth = sphere(pos=(0,0,0), radius=6.4e6) # a Visual object
bodies = [ship, Earth, Moon] # a list of objects
Operations:
2/3 (returns 0)
2./3.(returns 0.666666)
5**2 (powers)
from __future__ import division
- returns integers as floating point
- use two underscores before and after future
Printing/Input
x=raw_input('Enter x: ')
print "The speed is", v, "m/s."
Strings:
x=4.0
s=str(x)
Logical testing:
if x==y:
blah blah
elif x>y:
blah blah
else:
blah
Functions:
def function_name(arg1, arg2):
# statements
return something
Loops:
for i in arange(5): #short for arrayrange
ints = arange(10) #produces a sequence 0 to 10
for I in range(0,1,10)
statements
while 1: # infinite loop
rate(100)
statements
while x ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- startup restaurant business plan sample
- startup business plan example pdf
- startup business plan pdf
- startup business plan template
- tech startup business plan sample
- startup business plan example
- startup business plan template excel
- startup business plan template free
- tech startup business plan template
- business plan outline for a startup business
- startup business loans
- excel business startup template