Docsity

Python - Computer Literacy - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Python - Computer Literacy - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Python

Main Program and Functions

def initialize():

# set board to opening configuration.

return(board)

def scan(board):

# do the image processing and return internal board.

def play(move, board):

# physically move the chosen piece.

def choose(intboard):

# choose a move and return it.

game_on = True # Main program

board = initialize()

while game_on:

internal_board = scan(board)

move = choose(internal_board)

play(move, board)

Output of Vowels Fr scr nd svn rs g r fthrs brght frth n ths cntnnt, * nw ntn, cncvd n Lbrt, nd ddctd t th* prpstn tht ll mn r crtd ql.

Output of Vowels Fr scr nd svn rs g r fthrs brght frth n ths cntnnt, * nw ntn, cncvd n Lbrt, nd ddctd t th* prpstn tht ll mn r crtd ql.

People Are Flexible

When passenger on foot heave in sight, tootle the horn. Trumpet him melodiously at first, but if he still obstacles your passage, then tootle him with vigor. (Brochure of a car rental firm in Tokyo - courtesy of Far Eastern Economic Review ).

While Loops

def whilest():

while True:

st = input("$$$$$>") # then do something