Bắt đầu ngayBắt đầu miễn phí

Script the refund check

The support team has just uploaded this month's returns export, returns.csv, to the home folder of your session. It's messy, and a new one arrives every month, so instead of working out each product's refund rate by hand, have CoCo write a Python script that does it and that you can rerun.

Bài tập này là một phần của khóa học

Introduction to Snowflake CoCo CLI

Xem khóa học

Hướng dẫn bài tập

  • Start a CoCo session and paste this prompt: returns.csv is the support team's export of returned items. Using Python, clean it up, total the refunds for each product, compare each total with that product's revenue from the orders, and save the result as a new table SHOP.REFUND_RATE. Save the script as refunds.py and run it.
  • Approve CoCo's steps until it reports the refund rate for each product.
  • Close the session, then rerun the script yourself with python3.

Bài tập tương tác thực hành

Biến lý thuyết thành hành động với một trong các bài tập tương tác của chúng tôi

Bắt đầu bài tập