To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Sometimes your program has some specific problem, or bug: perhaps it fails to compile, or perhaps there is a situation in which it does not do what you want. This chapter helps you approach this difficult situation systematically: localising, understanding and removing the bug, and finally, taking action to reduce your chance of introducing a similar bug again. It discusses common problems, including non-termination and null pointer exceptions, and helpful techniques such as cardboard debugging and defensive programming.
Most students, at some stage, need help. Perhaps you are stuck on some specific point, or perhaps you feel generally confused. This chapter helps you to sort out what your problem is, and make a plan to fix it. When, and how, should you approach someone else – on your course, or on the wider internet – for help?
Learning to program isn't just learning the details of a programming language: to become a good programmer you have to become expert at debugging, testing, writing clear code and generally unsticking yourself when you get stuck, while to do well in a programming course you have to learn to score highly in coursework and exams. Featuring tips, stories and explanations of key terms, this book teaches these skills explicitly. Examples in Python, Java and Haskell are included, helping you to gain transferable programming skills whichever language you are learning. Intended for students in Higher or Further Education studying early programming courses, it will help you succeed in, and get the most out of, your course, and support you in developing the software engineering habits that lead to good programs.
Python is today's fastest growing programming language. This engaging and refreshingly different guide breaks down the skills into clear step-by-step chunks and explains the theory using brief easy-to-understand language. Rather than bamboozling readers with pages of mind-numbing technical jargon, this book includes 150 practical challenges, putting the power in the reader's hands. Through creating programs to solve these challenges the reader will quickly progress from mastering the basics to confidently using subroutines, a graphical user interface, and linking to external text, csv and SQL files. This book is perfect for anyone who wants to learn how to program with Python. In particular, students starting out in computer science and teachers who want to improve their confidence in Python will find here a set of ready-made challenges for classroom use.
In this final, most complicated challenge the reader needs to create a complete program that could be used by an art gallery to store a list of the art and artists in their collection. This should be stored in a relational SQL database which can be accessed by a graphical user interface.
This chapter introduces readers to another type of iteration and shows them how to create conditional controlled loops (using while loops). The seven challenges include nested code utilising and building on the skills they have learnt in previous chapters.
Comma Separated Value (.csv) files allow data to be stored in rows and columns that can be read by a spreadsheet. This gives the data more structure making it easier to identify. The reader completes seven challenges, including reading and writing .csv files, and removing data from a .csv file.
This chapter improves on the skills learnt in the previous chapter. The reader discovers how to use icons, images and drop-down lists to make more complex graphical user interfaces they can use to complete the six challenges.
In this challenge the reader must create a graphical user interface, which will display the times tables and will need to use the following skills: loops (while and for), subprograms and the Tkinter library.
Where variables only allow a single value to be stored, tuples, lists and dictionaries allow multiple values to be stored under a single name. The reader is shown how to create lists, insert data, delete values and sort the data which they use to complete the eleven challenges.
Iteration allows code to be repeated and this chapter shows the reader how to create count-controlled loops (using for loops) that implement the range expression. They complete ten challenges ensuring they are familiar with using iteration in their coding.
In this chapter the reader creates if statements, which include elif and else statements, and learns about nesting statements together. They become familiar with conditional operators such as greater than, less than and equal to along with comparison operators such as and, or and not as they build upon the knowledge they have acquired in the first chapter to program solutions for the eight given challenges.
The reader will use more advanced string manipulation and learn how to use index numbers to identify individual characters. Completing the eight challenges readers recap and embed the skills they have learnt from previous chapters.
For this challenge, the reader needs to create a program that will store the user ID and passwords for the users of a system in a .csv file. The skills they need include: input and display data, lists, if statements, loops (while and for), subprograms and saving to and reading from a .csv file.