1june

  • 홈

파이썬 3

Python Crash Course: 챕터 3

Listcars = ['Honda', 'KIA', 'BMW', 'Lada']print(cars)print(cars[0])print(cars[1])print(cars[-1])print(cars[-2])['Honda', 'KIA', 'BMW', 'Lada']HondaKIALadaBMW[ ] squares brackets must be used to create a listNotice how index starts from 0, not 1 Modifying elements in ListHere, I have replaced 'Honda' with 'Toyota' in the listcars = ['Honda', 'KIA', 'BMW', 'Lada']print(cars)cars[0] = 'Toyota'print..

Python/Python Crash Course 2024.06.25

Python Crash Course: 챕터 2

VariablesEvery variable is connected to a value, which is the information associated with that variable. message = "Hello Python world!"print(message)In this case the value is the "Hello Python world!" text.Variables in Python are commonly likened to boxes for storing values, which can be a useful analogy initially. However, a more accurate representation is to view variables as labels that are ..

Python/Python Crash Course 2024.06.23
이전
1 2
다음
더보기
프로필사진

1june

summarised what I have learned 배운 내용 정리

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

티스토리툴바