1june

  • 홈

Python/Python Crash Course 11

Python Crash Course: 챕터 9

ClassesMaking an object from a class is called instantiation, and you work with instances of a class.class Dog: """A simple attempt to model a dog.""" def __init__(self, name, age): """Initialize name and age attributes.""" self.name = name self.age = age def sit(self): """Simulate a dog sitting in response to a command.""" print(f"{self.name} is now s..

Python/Python Crash Course 2024.07.01

Python Crash Course: 챕터 8

functiondef favorite_book(title): """Display a message about someone's favorite book.""" print(f"{title} is one of my favorite books.")favorite_book('The Abstract Wild')Start with defGive a variable with parentheses (parameter), and end with colonExplain the function in triple quotesWrite a code about what the function doesCall the function with arguement in parentheses functions are named..

Python/Python Crash Course 2024.07.01
이전
1 2 3 4 5 6
다음
더보기
프로필사진

1june

summarised what I have learned 배운 내용 정리

  • 전체 글 (11)
    • Python (11)
      • Python Crash Course (11)
      • Side Projects (0)

티스토리툴바