1june

  • 홈

Python 11

Python Crash Course: 챕터 7

Input() functionThe input() function takes one argument: the prompt that we want to display to the user, so they know what kind of information to enter Use CTRL + '(backtick) to switch from editor pane to terminal paneprompt = "If you share your name, we can personalize the messages you see."prompt += "\nWhat is your first name? "name = input(prompt)print(f"\nHello, {name}!")Multiline string for..

Python/Python Crash Course 2024.06.29

Python Crash Course: 챕터 6

Dictionaryalien_0 = {'color': 'green', 'points': 5}Open and close by { } braces, key-value pair is distinguished by : colonprint(alien_0['color'])How to access 'color' key to get the valuealien_0['x_position'] = 0alien_0['y_position'] = 25print(alien_0)How to add key-value pair to the dictionaryyou can also modify the existing key using the same codeline format abovedel alien_0['x_position']del ..

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

1june

summarised what I have learned 배운 내용 정리

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

티스토리툴바