Python Bytes Lesson Eight: Classes & Objects Part 1

preview_player
Показать описание
HELLO, Python-ers!👋🏼

Welcome to Lesson Eight of Python Bytes. Today, you will learn about Classes & Objects. Python is an object oriented programming language.

Almost everything in Python is an object, with its properties and methods. A Class is like an object contructor, or a "blueprint" for creating objects. 🧠

Class Examples:

Happy coding! 👩🏽‍💻💡👨🏻‍💻

Links:

Materials Needed: PC, MAC, Chromebook, or tablet 💻
Experience Required: None!
Suggested Age: 8+

________________________________________________________________________________________________
Let us know in the comments section below what you enjoy and what we can improve, so that we can tailor our lessons to best help YOU👍🏼

Рекомендации по теме
Комментарии
Автор

Lesson 7 Homework

# Creates a list and prints a random member

from random import randint

fruit = ["apples", "oranges", "pears", "grapes", "bananas", "snozberries"]

x = randint(0, 5)

print(fruit[x])

# BONUS
# If you add or subtract an item from the list,
# you'll need to edit randint(0, 5). Or you
# could automatically determine the number of
# items in your list. This line of code looks
# like it should work, but there's a problem.
# Can you figure out how to fix it?

# x = randint(0, len(fruit))

burkmurray