MulaiMulai sekarang secara gratis

Exploring objects and classes

The best way to learn how to write object-oriented code is to study the design of existing classes.

In this exercise, you will explore objects of different classes to learn more about their attributes and methods.

Latihan ini adalah bagian dari kursus

Introduction to Object-Oriented Programming in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

ratio = 12 / 8

# List all attributes and methods for the ratio object
print(____(____))
Edit dan Jalankan Kode