PyCharm Edu 3.5 Help

Student's Guide

On this page:

Overview

This guide aims to help the students get a grip of PyCharm Edu and pass through the initial course of Python programming.

The first start

Having launched PyCharm Edu, you see the Welcome screen first. Here, choose the very first option Introduction to Python. PyCharm Edu silently creates a project, and opens it.

Now look at the new project:

/help/img/idea/2017.1/pe_intro_to_python.png

where (1) is the Project tool window, (2) is the editor, (3) is the Task Description tool window with the course progress bar (4), (5) is the Run tool window, and (6) is the Python Console tool button.

To learn what is a tool window and how to handle it, refer to the corresponding sections of the documentation.

As you see, the Project tool window contains the following major entities:

  • Lessons, marked /help/img/idea/2017.1/lesson.png. When a lesson is completed, its icon changes to /help/img/idea/2017.1/lesson_completed.png.
  • Tasks, marked /help/img/idea/2017.1/task.png. When a task is completed, its icon changes to /help/img/idea/2017.1/task_completed.png.
  • Python files, marked /help/img/idea/2017.1/pythonScript.png, and all other file types, supported by PyCharm Edu.
  • Sandbox, where you can create files and folders of your choice.

Creating an educational project

By the way, when you feel yourself better with Python, you can create an educational project yourself. To do this, just choose File | New Project... on the main menu, and follow the steps of the wizard.

This procedure is described in the corresponding section of this documentation.

As an exercise, let's explore the first lesson and fulfil its tasks.

Lesson 1. First program and comments

Expand the Introduction lesson /help/img/idea/2017.1/lesson.png. To do that, click right arrow /help/img/idea/2017.1/arrow_right_1.png next to the lesson name. You see the nested tasks /help/img/idea/2017.1/task.png:

/help/img/idea/2017.1/pe_intro_to_python1.png

Click /help/img/idea/2017.1/arrow_right_1.png next to the first task name, and see the Python file hello_world.py. This file is opened in the editor by default.

To the right of the editor, there is the Task Description tool window with the task text.

Above the task description, there is the toolbar with the following icons:

  • /help/img/idea/2017.1/check_task.png - click this button to make sure your answer was correct.
  • /help/img/idea/2017.1/arrowBack.png / /help/img/idea/2017.1/arrowForward.png - click these buttons to open the previous or next task in the editor.
  • /help/img/idea/2017.1/refresh_task.png - click this button to drop changes to a task and start it anew.
  • /help/img/idea/2017.1/intentionBulb.png - click this button to show prompt for the current task.

Executing a task

The editor tab is occupied by a task itself. A task consists of one or more frames that serve as placeholders for your code - you need to type your answer inside the placeholder.

In our case, you have to introduce yourself to the world, that is, type your name in the frame:

/help/img/idea/2017.1/pe_intro_to_python2.png

Before checking the task, you might want to run it - just to see for yourself how it works. For that, there is a special icon /help/img/idea/2017.1/run.png in the left gutter of the editor:

/help/img/idea/2017.1/pe_intro_to_python2a.png

If you click this icon, the current Python script will run and show you its output in the Run tool window:

/help/img/idea/2017.1/pe_intro_to_python2b.png

When ready, click /help/img/idea/2017.1/check_task.png in the Task Description tool window, to check whether the task within a placeholder has been executed correctly:

/help/img/idea/2017.1/pe_intro_to_python2c.png

Yes, you are right! Congrats are well deserved.

By the way, if you click /help/img/idea/2017.1/close.png in the Run tool window, the output will disappear. If your attempt was not correct, PyCharm Edu also informs you about it:

/help/img/idea/2017.1/pe_wrong_task.png

As you see in the Project tool window, the correctly executed task is marked green, while the incorrect task is marked red. Let’s get rid of red and repeat the task!

/help/img/idea/2017.1/pe_correct_task.png

Note that if a task contains more than one placeholder, each placeholder with correct code becomes green, while a placeholder with incorrect code becomes red. The entire task will be considered correct and marked green only when all the placeholders are filled in with correct code!

Navigating between tasks

As the current task has been successfully executed, let’s pass to the next one. To do that, click the right arrow button /help/img/idea/2017.1/arrowForward.png, or press Ctrl+Right. PyCharm Edu opens the next task in the editor. Note that the newly opened file that contains a yet untouched code, is underlined with the red curvy line, since there are syntax errors.

When you enter syntactically valid solution, this red curvy line will disappear.

Clicking the left arrow /help/img/idea/2017.1/arrowBack.png or pressing Ctrl+Left lets you jump to the previous task.

Starting a task all over again

Suppose now that you’ve made several attempts to execute a task, and now there are lots of changes, and you want to start everything from scratch.

In this case, click /help/img/idea/2017.1/refresh_task.png on the toolbar of the Task Description tool window, and see how PyCharm Edu returns to the original state of a task:

Getting task hints

If you are not sure what are you supposed to do to fulfil a task, you can always see the task description. It is always available in the Task Description tool window.

You can also view hints for each placeholder. To do that, place the caret in the answer placeholder and click /help/img/idea/2017.1/intentionBulb.png.

Navigating between answer placeholders

Suppose now that your task contains several placeholders, and you have to type something meaningful in each one. You know well enough the answer to the second question, but you are not sure about the first one, which now holds the highlight.

No problem - you can start with any question you like better. To do that, press Ctrl+Enter, and the placeholders of the next question now gets the focus:

/help/img/idea/2017.1/pe_jump_to_task_frame.png

Now type your answer here, and then press Ctrl+Enter again to jump to the first frame.

You can also switch between answer placeholders back and forth using Ctrl+Shift+Right/Ctrl+Shift+Right.

Using Python console

Finally, let’s try working in the console. Click the tool window button Python Console. The console starts, allowing you to enter commands:

/help/img/idea/2017.1/pe_console.png

Pressing Enter (/help/img/idea/2017.1/run.png) executes the current command. You can use the history of commands already entered in the console: press up or down arrow keys to navigate through the history.

Note that code completion is available in the Python console. For example, start typing the keyword ‘type’ and press Ctrl+Space after the first letters. PyCharm Edu suggests matches:

/help/img/idea/2017.1/pe_console1.png

Code completions after dot and after the opening parenthesis are also available:

/help/img/idea/2017.1/pe_console2.png

Pressing the toolbar button /help/img/idea/2017.1/show-watches.png shows you variables used in the current session:

/help/img/idea/2017.1/pe_console3.png

Refer to the section Interactive Console to learn more about the available controls.

How to reset the entire course?

At some point you may want to reset the entire course. There is no special button or menu entry for that in PyCharm Edu, so you have to do this manually.

To reset the entire course, follow these steps:

  1. On the main menu, choose File | New project...
  2. In the dialog box that opens, choose project type Educational.
  3. Specify the new directory for your project.

    If you are going to reset Introduction to Python, you have to delete the PythonIntroduction folder (this folder by default resides under your home folder in PycharmProjects/PythonIntroduction) - and the next time you’ll click the Introduction to Python option, PyCharm Edu will create a new educational project for you.

Adaptive courses

Do you feel yourself strong enough to skip the tasks too simple for you? Or you are not sure of yourself and would like to repeat the tasks more than once? If this is the case, you can choose the so-called adaptive course.

This is how it's done… In the New Project dialog (opened from the Welcome screen, or by choosing File | New Project... on the main menu) select Educational project type, and then, in the Courses drop-down list, choose Adaptive Python:

/help/img/idea/2017.1/pe_adaptive_python.png

Click Create. At last you educational project is ready. You see, that it slightly differs from the ordinary project:

/help/img/idea/2017.1/pe_adaptive_python_frames.png

Here (1) is the Project tool window with just one task and the Sandbox, (2) is the editor where you will type your code, and (3) is the Task Description tool window which features two buttons on top, Too Hard and Too Boring.

Oops! The task about squirrels seems too complicated… Let’s click the first button. PyCharm Edu loads the next, less complicated task:

/help/img/idea/2017.1/pe_adaptive_python_106.png

No, this task seems too simple… Let’s click the button Too Boring. This time, PyCharm Edu shows the more complex task:

/help/img/idea/2017.1/pe_adaptive_python_107.png

As you see, PyCharm Edu keeps an eye on how you tackle the tasks and suggests you the next task depending on your choice.

The only requirement for passing such a course is logging in to Stepic.

That completes the tutorial. You got a head start and now can further explore the PyCharm Educational Edition and learn Python along the way. We wish you best of luck!

Last modified: 31 July 2017