{"assignment":{"_schema_version":2,"course_id":37,"date_created":"2022-06-28T19:00:00+00:00","date_modified":"2023-08-26T13:53:55.769959+00:00","extra_instructor_files":"","extra_starting_files":"","forked_id":null,"forked_version":null,"hidden":false,"id":907,"instructions":"## Phases of a Program\n\n1. Input\n2. Processing\n3. Output\n\nEvery program has three main phases.\nFirst, input data is given to the program.\nSecond, the data is processed.\nThird, the data is output in some way to the user.\n_Inputs_ and _Outputs_ are how we connect programs to the real world.\n\n## Programming Is Like Baking\n\n![A sequence of three pictures with arrows connecting them. From left to right, there are ingredients (labeled \"inputs\"), a woman baking (\"processing\"), and a cake (\"outputs\")](intro_console_baking_process.png)\n\nThink of it like baking.\nThe inputs are your ingredients.\nMixing and stirring are the processing.\nThen, the cake is your output.\n\n## Inputs\n\n![Pictures of a mouse, keyboard, and some kind of USB stick with a sensor on it.](intro_console_inputs.png)\n\nExamples of input are data typed by a keyboard, movements made by your mouse, data from the internet, and data from sensors.\n\n## Processing\n\n![Pictures of math, text manipulation, and a logical query](intro_console_processing.png)\n\nExamples of processing are operations that do math, manipulate text, and make logical queries.\n\n## Outputs\n\n![Pictures of a monitor, printer, and a robot.](intro_console_outputs.png)\n\nExamples of output are pixels on your screen, paper out of your printer, or the movement of a robotic arm.\n\n## Code\n\n* `input`: A function to get data from the user\n* `print`: A function to give data to the user\n\nComputers take in data from users and put out results.\nTo transform the inputs into the outputs, we write instructions as code.\nThe instructions that we write are often stored in a program, so that they can be reused. This is what \"programs\" or \"code\" really are.\nNow let's learn how to write a very simple program by learning two basic commands (which we will also call \"functions\"):\n\nThe `input` command will let us get information from the user.\nThe `print` command will let us report information to the user.\nLet us take a look at what these commands look like in our very first, simple programs.\n\n## Print\n\n```python print-example\nprint(\"This text will be shown to the user\")\n```\n\nThe `print` function lets you write information to users.\nPrinting is necessary because we cannot see \"inside\" the mind of the computer when a program runs.\nFor now, the only thing we end up seeing is the result of whatever we print. \nNotice that there is some text between the parentheses: this is the text that is output to the user.\n\nTry running this program.\nRun the code and verify the message that \"printed\" on the console.\nYou can think of the console as like a messenger box, for sending and receiving data to and from the computer.\nEvery time you run this program, the exact same text will be written in the console by the computer.\n\n## Input\n\n```python input-example\nfavorite_color = input(\"What is your favorite color?\")\nprint(\"Your favorite color is\", favorite_color)\n```\n\nThe `input` function lets you get information from users.\nThe code here demonstrates incorporating the `input` function along with `print`.\nTry running the program.\nNotice that once again there is text between parentheses asking for their favorite color.\nThat text will be shown as a prompt to the user in the console.\nThe user will be able to type their answer and press Enter.\nOn the second line, we used the `print` function to print out that same information.\nWithout that `print`, this program would only ask the user for their color, without ever reporting anything back at the end.\nWhile not a very big program, this is a demonstration of the input-processing-output workflow that every program will have.\n\n## The Goal of Programs\n\n![On the left, a circle is labeled \"Types of Data\", with smaller circles sticking out - these smaller circles are labeled nouns like \"geographical\", \"financial\", \"scientific\", \"statistical\", and \"cultural\". On the right, an arrow labeled \"Python\" points to a person thinking.](intro_console_why.png)\n\nThe goal of any program is to transform the input data into the desired outputs.\nFor now, our programs will have simple inputs and simple outputs that work through the console.\nBut eventually, we will create complex code that can achieve great things.\nFor example, you could have the user speak into a microphone, with their instructions translated into the movement of a robot.\nOr, have the user input recent weather data in order to create the output of future weather predictions.\n\nRemember: The goal of almost any program is to process input data into the appropriate output on behalf of a user. \nYou should always think about your programs in terms of how they help a user achieve some goal. \nKeeping humans at the center of the development process is often essential to making software that helps people.\n\n## Summary\n\n- Every program can be broken down into the stages of taking input, processing the data, and then presenting output.\n- The terminal, also known as a console, is one of the simplest places for the input and output to occur.\n- In Python, we use the `input` and `print` functions to interact with the terminal from our programs.\n- Eventually, we will build much more sophisticated programs that have other ways of interacting with the user.\n","ip_ranges":"","name":"1A3) Console I/O Reading","on_change":"","on_eval":"","on_run":"","owner_id":1,"owner_id__email":"acbart@udel.edu","points":0,"public":true,"reviewed":false,"sample_submissions":[],"settings":"{\n  \"header\": \"Console Input/Output\",\n  \"slides\": \"bakery_intro_console.pdf\",\n  \"youtube\": {\n    \"Bart\": \"xwVPAVx9T_0\",\n    \"Amy\": \"_FJtLkJ5xtw\"\n  },\n  \"video\": {\n    \"Bart\": \"https://blockpy.cis.udel.edu/videos/bakery_intro_console-Bart.mp4\",\n    \"Amy\": \"https://blockpy.cis.udel.edu/videos/bakery_intro_console-Amy.mp4\"\n  },\n  \"summary\": \"In this lesson, you will learn how to write programs that use input and output.\",\n  \"small_layout\": true\n}","starting_code":"","subordinate":true,"tags":[],"type":"reading","url":"bakery_intro_console_read","version":9},"ip":"216.73.216.157","submission":{"_schema_version":3,"assignment_id":907,"assignment_version":9,"attempts":0,"code":"","correct":false,"course_id":37,"date_created":"2026-05-20T16:04:45.419594+00:00","date_due":"","date_graded":"","date_locked":"","date_modified":"2026-05-20T16:04:45.419594+00:00","date_started":"","date_submitted":"","endpoint":"","extra_files":"","feedback":"","grading_status":"NotReady","id":2037038,"score":0.0,"submission_status":"Started","time_limit":"","url":"submission_url-2a81521f-0c3f-469f-8712-c5399f90c3d7","user_id":2044700,"user_id__email":"","version":0},"success":true}
