Python for Kids: A Playful Introduction to Programming

By Jason R. Briggs

For young ones elderly 10+ (And Their Parents)

The code during this ebook runs on nearly whatever: home windows, Mac, Linux, even an OLPC desktop or Raspberry Pi!

Python is a robust, expressive programming language that is effortless to benefit and enjoyable to exploit! yet books approximately studying to application in Python could be type of uninteresting, grey, and dull, and that is no enjoyable for anyone.

Python for Kids brings Python to lifestyles and brings you (and your mom and dad) into the realm of programming. The ever-patient Jason R. Briggs will advisor you thru the fundamentals as you scan with exact (and usually hilarious) instance courses that characteristic starving monsters, mystery brokers, thieving ravens, and extra. New phrases are outlined; code is coloured, dissected, and defined; and quirky, full-color illustrations preserve issues at the lighter side.

Chapters finish with programming puzzles designed to stretch your mind and increase your figuring out. through the tip of the publication you will have programmed entire video games: a similar to the recognized Pong and "Mr. Stick guy Races for the Exit"—a platform online game with jumps, animation, and masses more.

As you strike out in your programming experience, you are going to find out how to:

  • Use primary info constructions like lists, tuples, and maps
  • Organize and reuse your code with capabilities and modules
  • Use keep an eye on constructions like loops and conditional statements
  • Draw shapes and styles with Python's turtle module
  • Create video games, animations, and different graphical wonders with tkinter

Why may still severe adults have the entire enjoyable? Python for Kids is your price ticket into the superb international of laptop programming.

Show description

Preview of Python for Kids: A Playful Introduction to Programming PDF

Similar Children books

Dragon's Egg

It's a infrequent expertise, and in basic terms she will be able to deal with the Inn's herd. She feeds them, gathers their eggs, and has a tendency to their accidents. yet Mella goals in regards to the dragons of legend, although rarely somebody believes they nonetheless exist. Dragons are small cattle, no longer large fire-breathing monsters. we all know that.

Raising the Perfect Child Through Guilt and Manipulation

Well known actress and stand-up comedienne Elizabeth Beckwith provides us the parenting consultant to finish all parenting courses: elevating the fitting baby via Guilt and Manipulation. A widespread visitor at the past due, overdue express and considered one of seven comics featured within the Time journal article, “Funny: the subsequent Generation,” Beckwith now places forth a hilarious new parenting philosophy that may surprise Dr.

Not Just a Witch

Hectate Tenbury-Smith can flip humans into animals, and create new animals out of skinny air. She’s an animal witch, and a up to date graduate of a faculty for strong witches. made up our minds to make the area a greater position, Heckie befriends a boy named Daniel, and informs him of her venture to do stable by way of turning undesirable humans into animals.

Additional resources for Python for Kids: A Playful Introduction to Programming

Show sample text content

Identification = canvas. create_oval(10, 10, 25, 25, fill=color) self. canvas. move(self. identification, 245, a hundred) starts off = [−3, −2, −1, 1, 2, three] random. shuffle(starts) self. x = starts[0] self. y = −3 self. canvas_height = self. canvas. winfo_height() self. canvas_width = self. canvas. winfo_width() self. hit_bottom = fake def hit_paddle(self, pos): paddle_pos = self. canvas. coords(self. paddle. identification) if pos[2] >= paddle_pos[0] and pos[0] <= paddle_pos[2]: if pos[3] >= paddle_pos[1] and pos[3] <= paddle_pos[3]: go back precise go back fake def draw(self): self. canvas. move(self. identification, self. x, self. y) pos = self. canvas. coords(self. identification) if pos[1] <= zero: self. y = three if pos[3] >= self. canvas_height: self. hit_bottom = actual if self. hit_paddle(pos) == precise: self. y = −3 if pos[0] <= zero: self. x = three if pos[2] >= self. canvas_width: self. x = −3 category Paddle: def __init__(self, canvas, color): self. canvas = canvas self. identity = canvas. create_rectangle(0, zero, a hundred, 10, fill=color) self. canvas. move(self. identification, 2 hundred, three hundred) self. x = zero self. canvas_width = self. canvas. winfo_width() self. canvas. bind_all('', self. turn_left) self. canvas. bind_all('', self. turn_right) def draw(self): self. canvas. move(self. identification, self. x, zero) pos = self. canvas. coords(self. identification) if pos[0] <= zero: self. x = zero elif pos[2] >= self. canvas_width: self. x = zero def turn_left(self, evt): self. x = −2 def turn_right(self, evt): self. x = 2 tk = Tk() tk. title("Game") tk. resizable(0, zero) tk. wm_attributes("-topmost", 1) canvas = Canvas(tk, width=500, height=400, bd=0, highlightthickness=0) canvas. pack() tk. update() paddle = Paddle(canvas, 'blue') ball = Ball(canvas, paddle, 'red') whereas 1: if ball. hit_bottom == fake: ball. draw() paddle. draw() tk. update_idletasks() tk. update() time. sleep(0. 01) What You realized during this bankruptcy, we entire developing our first online game utilizing the tkinter module. We created sessions for the paddle utilized in our online game, and used coordinates to examine while the ball hits the paddle or the partitions of our online game canvas. We used occasion bindings to bind the left and correct arrow keys to the stream of the paddle, and used the most loop to name the draw functionality, to animate it. eventually, we replaced our code to provide our online game a component of probability, in order that while the participant misses the ball, the sport is over while the ball hits the ground of the canvas. Programming Puzzles in the intervening time, our online game is a section basic. There’s much you'll switch to create a extra expert online game. attempt bettering your code within the following how one can make it extra fascinating, after which money your solutions at http://python-for-kids. com/. no 1: hold up the sport begin Our online game starts off a piece speedy, and also you have to click on the canvas earlier than it's going to realize urgent the left and correct arrow keys in your keyboard. are you able to upload a hold up to the beginning of the sport with a purpose to provide the participant sufficient time to click on the canvas? or perhaps greater, are you able to upload an occasion binding for a mouse click on, which begins the sport in simple terms then?

Download PDF sample

Rated 4.88 of 5 – based on 24 votes