{"assignment":{"_schema_version":2,"course_id":37,"date_created":"2022-06-28T19:00:00+00:00","date_modified":"2023-08-26T13:43:06.444506+00:00","extra_instructor_files":"","extra_starting_files":"","forked_id":null,"forked_version":null,"hidden":false,"id":900,"instructions":"# Introduction to the Book\n\n![A picture of two friendly Python snakes with baking ingredients on their left and a finished cake on their right. The title \"The Python Bakery\" are above them.](intro_primer_baking.png)\n\nHello, and welcome to the world of Computer Science!\n\nWe are going to learn how to *program*: writing instructions in a *programming language* that a computer can *run* for us. By running these instructions, we can transform *data* to solve *problems*, which is the real goal of Computer Science.\n\nPrograms are a lot like a recipe. You start with some ingredients, perform actions with them, and then you end up with a result. But creating the recipe itself isn't easy - sometimes it takes many attempts and you get messy along the way. But that's okay, because you can clean up and try again.\n\nIn this book, we'll be teaching you how to write programs in a popular language called Python. Hence, the name of this book: the Python Bakery. But the point is not to \"bake\" Python programs - the point is to learn how to make the recipes themselves. The things we learn will transcend Python and will make you a Computer Scientist. You will solve new problems that don't even exist yet!\n\n ## Layout of the Book\n\n![A graphical layout of the book's chapters, highlighting that they are composed of a primer and two parts, which are in turn composed of lessons, quizzes, and coding problems.](intro_primer_book_layout.png)\n\nThis book has 11 chapters, with two parts per chapter. Each part has a bunch of readings, short quizzes, and programming problems to help you learn. Each chapter will also start with a short overview, just like this one.\n\nThis first chapter may look long, but we promise it's not that bad. Things that seem complicated at first often turn out to be much simpler once you try them out. Take your time and practice patience. Eventually you will finish everything, and we hope you have fun along the way! \n\nBut for now, let's get a short overview of the basics. Don't worry if parts confuse you - the rest of the chapter will go into a lot more detail!\n\n## Abstracting Data\n \n\n* Integers: `5`, `29`, `1774`, `-3`\n* Float: `1.5`, `0.66`, `199.99`\n* Strings: `\"Hello World!\"`, `\"Apple\"`\n* Boolean: `True`, `False`\n\nAll programs begin and end with data. We *input* data from the real world into the computer (\"abstracting\") as *values*. We organize values by *type*. In Python, our core types will be integer numbers, decimal floats, string text, and boolean logical values. The names may sound a little strange, but the example values should seem normal.\n\n## Messing with Data\n\n```python example\nmovie_length = 126\nads_length = 12 \nhours = (movie_length + ads_length)/60\nis_long_movie = hours > 2\nprint(\"Will this be a long movie?\", is_long_movie)\n```\n\nOnce data is inside the computer, you can use *operations* to do math and ask questions. The result of the operations will be *substituted* so that you can make complex *expressions*. You can assign the result of expressions to *variables* to reuse the results in later operations. Variables are names that refer to values that change over time, unlike variables from math class.\n\nWhen all the operations finish, the program needs to output the final values to the user. In baking terms, this means delivering the finished cake or pie to the client. In our early programs, this will mean *printing* the values.\n\nA Python program, also called a Module, is made of lines called *statements* that tell the computer what to do. These statements execute one at a time, from top to bottom. At each step of the program, you can *trace* the values of all the variables. Computers are so fast at running programs, it looks like it happens all at once. Do not be fooled - running a program is like a play or a movie acted out from a script.\n\n## The Process of Programming\n\n![Some snakes looking confused but determined to learn](intro_primer_confused.png)\n\nOnce a program works, you will want to share it with other people. Good programmers have many practices to make it easier for others to *import* and use their code. For example, they write *comments* inside their program that explain their code. They also choose good names for their variables so their purpose is clear. We will learn many best practices, although they take time to settle in.\n\nWriting programs is hard, and it's easy to make mistakes. When a program fails, Python will usually show us an error message that helps us understand what went wrong. Getting errors is a perfectly normal part of writing programs, even when you become experienced. Do not feel bad about yourself when your program does not work at first. Practice, and this book, will help you become successful in Computer Science.\n\nThat's an overview of the things we will learn more about in this chapter. Once again, do not worry if you didn't understand. We are about to explain all of it in a lot more depth! Remember, practice and patience are key to both baking and programming!","ip_ranges":"","name":"1) Primer Reading","on_change":"","on_eval":"","on_run":"","owner_id":1,"owner_id__email":"acbart@udel.edu","points":4,"public":true,"reviewed":false,"sample_submissions":[],"settings":"{\n  \"header\": \"Chapter 1) Introduction\",\n  \"summary\": \"This chapter introduces the book and many core concepts about Computer Science.\",\n  \"slides\": \"bakery_intro_primer.pdf\",\n  \"youtube\": {\n    \"Bart\": \"7udRWiWoyD4\",\n    \"Amy\": \"5iQU0IISQGY\"\n  },\n  \"video\": {\n    \"Bart\": \"https://blockpy.cis.udel.edu/videos/bakery_intro_primer-Bart.mp4\",\n    \"Amy\": \"https://blockpy.cis.udel.edu/videos/bakery_intro_primer-Amy.mp4\"\n  },\n  \"small_layout\": true\n}","starting_code":"","subordinate":true,"tags":[],"type":"reading","url":"bakery_intro_primer_read","version":17},"ip":"216.73.216.157","submission":{"_schema_version":3,"assignment_id":900,"assignment_version":17,"attempts":0,"code":"","correct":false,"course_id":37,"date_created":"2026-05-20T16:04:48.926217+00:00","date_due":"","date_graded":"","date_locked":"","date_modified":"2026-05-20T16:04:48.926217+00:00","date_started":"","date_submitted":"","endpoint":"","extra_files":"","feedback":"","grading_status":"NotReady","id":2037045,"score":0.0,"submission_status":"Started","time_limit":"","url":"submission_url-da37b1a3-4329-456d-80e7-4dc88c5fa3b9","user_id":2044700,"user_id__email":"","version":0},"success":true}
