コース修了おめでとうございます!

開発者のためのPython入門

Jasmin Ludolf

Senior Data Science Content Developer

第1章のまとめ

# Define quantity
quantity = 10

# Single quotes ingredient_name = 'pasta'
# Double quotes also work ingredient_name = "pasta"
開発者のためのPython入門

第2章のまとめ

ingredient_name = "Basil Leaves"


# Convert to lowercase ingredient_name = ingredient_name.lower()
# List of ingredients
ingredients = ["pasta", "tomatoes", "garlic",
               "basil", "olive oil", "salt"]

# Get the value at the first index ingredients[0]
# Creating a dictionary
recipe_dict = {"pasta": 500,
               "tomatoes": 400, 
               "garlic": 15,
               "basil": 20, 
               "olive oil": 30,
               "salt": 5}
# Create a set
ingredients_set = {"pasta", "tomatoes", "pasta", 
                   "basil", "garlic", "olive oil",
                   "salt"}

# Create a tuple serving_sizes = (1, 2, 4, 6, 8)
開発者のためのPython入門

第3章のまとめ

演算子 機能
== 等しい
!= 等しくない
>
>= 以上
< 未満
<= 以下
キーワード 機能 用法
if 条件が満たされている場合 ワークフローの最初
elif 次の条件が満たされている場合 if の後
else それ以外の場合は命令を実行 elif の後
開発者のためのPython入門

第3章のまとめ

# Ingredients list
ingredients = ["pasta", "tomatoes", "garlic", "basil", "olive oil", "salt"]


# Loop through and print each ingredient for ingredient in ingredients:
print(ingredient)
pasta
tomatoes
garlic
basil
olive oil
salt
開発者のためのPython入門

第3章のまとめ

ingredients_to_add = 5
items_added = 0

while items_added < ingredients_to_add:
    items_added += 1
    remaining = ingredients_to_add - items_added

    if remaining > 3:
        print("Several ingredients remaining")
    elif remaining >= 1:
        print("Almost done!")
    else:
        print("Shopping list complete!")
開発者のためのPython入門

第3章のまとめ

キーワード 機能
and 複数の条件が真かどうかを評価
or 1つ以上の条件が真であるか評価
in データ構造内に値があるか評価
not データ構造に値が含まれていないかを評価
  • list.append()
開発者のためのPython入門

次のステップ

  • さらなる組み込み関数

    • zip()
    • enumerate()
  • パッケージとモジュール

    • os
    • time
    • venv
    • pandas
    • requests
    • numpy
  • カスタム関数の作成

$$

  • DataCamp 開発者向けPython中級 コース
開発者のためのPython入門

コース修了おめでとうございます!

開発者のためのPython入門

Preparing Video For Download...