Information about cookies on this page

Our website uses cookies to ensure the functionality of the website, to collect and analyze information about the performance and usage of the website. Privacy Policy

  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in
  
  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in

Summary

In this lesson, you learned that:

  • The AI sees only what you send it, not your editor or your console. An attached program goes as it is at that moment, so attach it again after you change it.
  • An explanation is only as good as you can follow it. Say what you know and what's new to you, and ask for the program line by line.
  • Ask about one thing with a case, such as what a function gives for 60 minutes, and you get every step with numbers you can check.
  • When an answer uses something you haven't learned, you can ask for the same program without it, using what you know.
  • A program can confirm what the AI says about it: run it, and add a line that prints what you asked about.

Practice it all at once. The program in the editor adds up Mia's walks and prints the time in hours and minutes, with a function you haven't met: divmod().

Next comes Say What the Code Should Do: how to ask for code so that you get the code you need.

Instructions

  1. 1

    Attach script.py, say that you know // and % but not divmod(), and ask what the line with divmod() does with these walks, worked out with the numbers. Then send it.

  2. 2

    Check it by running the program. Then add a walk of 25 minutes at the end of the list and run it again: the walks now add up to exactly three hours, and the program prints Time: 3 h 0 min.

Back

7/7

  1. 1. It Sees Only What You Send
  2. 2. Explained at Your Level
  3. 3. Quiz: Numbered Walks
  4. 4. Ask About One Thing
  5. 5. Without That
  6. 6. Quiz: What It Knows About Your Program
  7. 7. Summary
Next

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with: