In14 printa whole new cellnneighth notenearth globe

This preview shows page 2 - 4 out of 8 pages.

# In[14]: print("A whole new cell!\n\N{EIGHTH NOTE}\N{EARTH GLOBE ASIA-AUSTRALIA}\N{EIGHTH NOTE}") # ### 1.4. Errors # Python is a language, and like natural human languages, it has rules. It differs from natural language in two important ways: # 1. The rules are *simple*. You can learn most of them in a few weeks and gain reasonable proficiency with the language in a semester. # 2. The rules are *rigid*. If you're proficient in a natural language, you can understand a non-proficient speaker, glossing over small mistakes. A computer running Python code is not smart enough to do that. # # Whenever you write code, you'll make mistakes. When you run a code cell that has errors, Python will sometimes produce error messages to tell you what you did wrong. # # Errors are okay; even experienced programmers make many errors. When you make an error, you just have to find the source of the problem, fix it, and move on. # # We have made an error in the next cell. Run it and see what happens. # In[16]: print("This line is missing something.")
Image of page 2
# You should see something like this (minus our annotations): # # <img src="error.jpg" alt=""/> # # The last line of the error output attempts to tell you what went wrong. The *syntax* of a language is its structure, and this `SyntaxError` tells you that you have created an illegal structure. "`EOF`" means "end of file," so the message is saying Python expected you to write something more (in this case, a right parenthesis) before finishing the cell. # # There's a lot of terminology in programming languages. You'll learn as you go. If you are ever having trouble understanding an error message, search the discussion forum. If you don't find an answer, post a question about the error yourself. # # Try to fix the code above so that you can run the cell and see the intended message instead of an error. # ### 1.5. The Kernel # The kernel is a program that executes the code inside your notebook and outputs the results. In the top right of your window, you can see a circle that indicates the status of your kernel. If the circle is empty (?), the kernel is idle and ready to execute code. If the circle is filled in (?), the kernel is busy running some code. # # You may run into problems where your kernel is stuck for an excessive amount of time, your notebook is very slow and unresponsive, or your kernel loses its connection. If this happens, try the following steps: # 1. At the top of your screen, select **Kernel**, then **Interrupt**. # 2. If that doesn't help, select **Kernel**, then **Restart**. If you do this, you will have to run your code cells from the start of your notebook up until where you paused your work. # 3. If that doesn't help, restart your server. First, save your work by selecting **File** at the top left of your screen, then **Save and Checkpoint**. Next, select **Control Panel** at the top right. Choose **Stop My Server** to shut it down, then **My Server** to start it back up. Then, navigate back to the notebook you were working on.
Image of page 3
Image of page 4

You've reached the end of your free preview.

Want to read all 8 pages?

  • Fall '17
  • DNA, Cell type, jupyter notebooks

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes