{"assignment":{"_schema_version":2,"course_id":37,"date_created":"2022-06-28T19:00:00+00:00","date_modified":"2024-02-13T16:51:09.626745+00:00","extra_instructor_files":"","extra_starting_files":"","forked_id":null,"forked_version":null,"hidden":false,"id":915,"instructions":"## The Basic Types\n\n* `143`: Integer  \n* `44.07`: Float  \n* `\"This is a string\"`: String  \n* `True`: Boolean  \n* `None`: None\n\nAll values in Python have a type.\nThe five basic types are: integer, float, string, Boolean, and None.\nThere are many other types you will learn about later.\nBasically, _types_ are a way to group values based on how they are related.\n_Text_ is very different from numbers, so there are different types for text and numbers.\nThere are also different types of numbers, though, and other types, too.\n\n## What are Types\n\n```python valid-operations\n# These will work fine\nprint(1 + 2)\nprint(1 - 2)\nprint(1 * 2)\nprint(\"Adding strings \" + \"is great\")\n\n# This will break!\nprint(\"Can't subtract\" - \"strings\")\n```\n\nTypes control what you can and can\u2019t do with things.\nWe know that a number is a number because we can add it to another number, or subtract it, or multiply it.\nWe can add two strings together, but we cannot subtract them \u2014 this is one reason why a string and a number are different.\nSo, another way of thinking about types is that they are a set of rules for what you can and can't do with values.\n\n## Integer Types (int)\n\n```python example-ints\nprint(-1024)\nprint(-55)\nprint(0)\nprint(1)\nprint(13)\nprint(1737)\n```\n\nInteger types are whole numbers.\nThey include both negative and positive numbers, so there are a lot of them.\nInteger is often shortened to `int` for convenience.\n\n## Float Types (float)\n\n```python example-floats\nprint(-56.4)\nprint(-1.0)\nprint(.0)\nprint(0.5)\nprint(1.02)\nprint(100.)\n```\n\nWhen numbers have decimals, we call them _float_ types.\nThe decimal is what distinguishes floats and integers.\nRemember: if a number has a period in it, then it is a float!\nEven if a number seems to be a whole number, Python will consider the number to be a float so long as there is a decimal somewhere in the number.\n\n## String Types (str)\n\n```python example-strings\nprint(\"My name is Anna\")\nprint(\"\")\nprint(\"Doggo\")\nprint(\"5\")\nprint(\"Four Score and Seven Years ago...\")\n```\n\nText data is represented using _string_ values.\nThe tricky thing about strings is that _anything_ can be stored as a string.\nThe only thing that makes it a string is the quotes.\nA special case is the \"empty string,\" which is a pair of quotes with nothing inside.\nString is often shorted to `str` for convenience.\n\n\n## Boolean Types (bool)\n\n```python example-booleans\nprint(True)\nprint(False)\n```\n\nSurprisingly often in programming, we are faced with \"yes or no\" values.\nThese two values are referred to as _Boolean_ values.\nSpecifically, we have a True and a False value.\nNote that the T and F are capitalized, and there are no quotes around the words.\nBooleans are different from strings! Boolean is often shortened to `bool` for convenience.\n\n## The None Type (None)\n\n```python example-none\nprint(None)\n```\n\nSometimes, you need to represent the absence of value, which we call `None`.\nThe _None_ type is a special type that has only one value.\nThe None type can be hard to wrap your head around, so we'll save that one for later.\nFor now, just remember that it has a capital N and no quotes.\n\n## Summary\n\n- Python has five basic types of values to represent data.\n    -   Integers are whole numbers.\n    -   Floats are decimal numbers.\n    -   Strings are textual data surrounded by quotes.\n    -   Booleans are `True` or `False` values that represent the answer to questions.\n    -   `None` represents the specific absence of a value.\n","ip_ranges":"","name":"1A5) Types 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\": \"Types\",\n  \"slides\": \"bakery_intro_types.pdf\",\n  \"youtube\": {\n    \"Bart\": \"HfmZ5vhA0Q4\",\n    \"Amy\": \"BqqYgax-7Aw\"\n  },\n  \"video\": {\n    \"Bart\": \"https://blockpy.cis.udel.edu/videos/bakery_intro_types-Bart.mp4\",\n    \"Amy\": \"https://blockpy.cis.udel.edu/videos/bakery_intro_types-Amy.mp4\"\n  },\n  \"summary\": \"In this lesson, you will learn about how data is organized as types.\",\n  \"small_layout\": true\n}","starting_code":"","subordinate":true,"tags":[],"type":"reading","url":"bakery_intro_types_read","version":7},"ip":"216.73.216.157","submission":{"_schema_version":3,"assignment_id":915,"assignment_version":7,"attempts":0,"code":"","correct":false,"course_id":37,"date_created":"2026-05-20T23:50:35.497532+00:00","date_due":"","date_graded":"","date_locked":"","date_modified":"2026-05-20T23:50:35.497532+00:00","date_started":"","date_submitted":"","endpoint":"","extra_files":"","feedback":"","grading_status":"NotReady","id":2037094,"score":0.0,"submission_status":"Started","time_limit":"","url":"submission_url-baab421d-a410-43f9-a5b0-99c55a6db9d8","user_id":2044772,"user_id__email":"","version":0},"success":true}
