Coding Py

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

print()

len()
for _ in range()
square()
sub()
add()
int()
float()
str()
type()
for()
input()

TURTLE module

import turtle
wn = turtle.Screen()
wn.bgcolor("lightgreen")
said = turtle.Turtle()
said.color("")
said.shape("turtle,arrow,blank,circle,classic,triangle")
dist = 5
said.up()
for _ in range():
said.stamp()
said.forward(dist)
said.right()
dist =
wn.exitonclick()

RANDOM module
import random
prob = random.random()
diceThrow = random.randrange()

list = []
tuple =()

name.split()
name.join()
slice operator
[n:m]

nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]


accum = 0
for w in nums:
accum = accum + w
print(accum)

count = 0
for w in nums:
count = count + 1
print(count)

fruits = []
for n in range(.):
print(n, fruits[n])
fruits = []
for n in range(len(fruits)):
print(n, fruits[n])

You might also like