{"id":665,"date":"2018-11-12T17:37:13","date_gmt":"2018-11-12T17:37:13","guid":{"rendered":"http:\/\/learnlearn.uk\/gcsecs\/?page_id=665"},"modified":"2018-11-13T09:42:31","modified_gmt":"2018-11-13T09:42:31","slug":"data-types","status":"publish","type":"page","link":"https:\/\/learnlearn.uk\/gcsecs\/data-types\/","title":{"rendered":"Data Types"},"content":{"rendered":"\n<div class=\"arconix-tabs-horizontal\"><ul class=\"arconix-tabs\"><li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-String\"><a class=\"\" href=\"#tab-String\">String<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-Integer\"><a class=\"\" href=\"#tab-Integer\">Integer<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-FloatReal\"><a class=\"\" href=\"#tab-FloatReal\">Float \/ Real<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-Boolean\"><a class=\"\" href=\"#tab-Boolean\">Boolean<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-Char\"><a class=\"\" href=\"#tab-Char\">Char<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-TypeCasting\"><a class=\"\" href=\"#tab-TypeCasting\">Type Casting<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-Quiz\"><a class=\"\" href=\"#tab-Quiz\">Quiz<\/a><\/li>\n<li data-arconix-icon=\" \" data-arconix-color=\" \" class=\"arconix-tab tab-Resources\"><a class=\"\" href=\"#tab-Resources\">Resources<\/a><\/li><\/ul>\n<div class=\"arconix-panes\"><div class=\"arconix-pane pane-String\">\n<h3>Strings<\/h3>\n<p><span style=\"color: #0000ff;\">&#8220;Bob&#8221;\u00a0 \u00a0&#8220;Passsword@123&#8221;<\/span><\/p>\n<p>Strings are used to store a mixture of alphanumerical characters, or other characters, such as . , @:()\u00a0 etc.<\/p>\n<p>Data that might be stored as a string include:<\/p>\n<ul>\n<li>Names<\/li>\n<li>Passwords<\/li>\n<li>Telephone numbers (because they don&#8217;t just contain numbers&#8230;)<\/li>\n<li>Sentences \/ paragraphs<\/li>\n<\/ul>\n<p>Most input functions store inputs as text\u00a0 by default, so if they need to stored in an alternative data type they need to be cast or reassigned.<\/p>\n<\/div>\n<div class=\"arconix-pane pane-Integer\">\n<h3>Integers<\/h3>\n<p><span style=\"color: #0000ff;\">5\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0200\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 -75\u00a0 \u00a0 \u00a0 \u00a0 73000000000<\/span><\/p>\n<p>Integers are positive or negative whole numbers<\/p>\n<p>Data the might be stored in integers include:<\/p>\n<ul>\n<li>Age<\/li>\n<li>Weight( in whole kgs)<\/li>\n<li>Temperatures<\/li>\n<li>Currency amounts (e.g. pence)<\/li>\n<\/ul>\n<\/div>\n<div class=\"arconix-pane pane-FloatReal\">\n<h3>Floats \/ Real<\/h3>\n<p><span style=\"color: #0000ff;\">4.234543\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 -41.00\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 43.719<\/span><\/p>\n<p>Floats (or Reals) are positive or negative numbers that include a decimal place.<\/p>\n<p>They can be used to store values where a decimal place is needed.<\/p>\n<ul>\n<li>Currency in pounds E.g. 4.25<\/li>\n<li>Precise measurements in meters 4.25m<\/li>\n<li>Temperatures with decimal places<\/li>\n<\/ul>\n<\/div>\n<div class=\"arconix-pane pane-Boolean\">\n<h3>Booelans<\/h3>\n<p><span style=\"color: #0000ff;\">True\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0False<\/span><\/p>\n<p>Booleans are used to store True \/ False values<\/p>\n<p>Any data where a True or False\u00a0 value is appropriate:<\/p>\n<ul>\n<li>Is a member of a club?<\/li>\n<li>Is the person coming?<\/li>\n<\/ul>\n<\/div>\n<div class=\"arconix-pane pane-Char\">\n<h3>Char<\/h3>\n<p><span style=\"color: #0000ff;\">M\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 F<\/span><\/p>\n<p>A char is used where there are a limited number of possibilities, but too many to use a Boolean. Chars use up less space than strings because only one value is stored.<\/p>\n<p>For instance:<\/p>\n<ul>\n<li>Infant, Child or Adult can be stored under\u00a0 I\/C\/A<\/li>\n<li>Gender types male,female,other\u00a0 \u00a0M\/F\/O<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"arconix-pane pane-TypeCasting\">\n<h3>Type Casting<\/h3>\n<p><span style=\"color: #0000ff;\">print(&#8220;You are &#8221; + str(age) + &#8221; years old&#8221;)<\/span><\/p>\n<p>Often a variable is stored as one type but is sometimes needed to be represented temporarily as another type. In this instance variable casting needs to be used. The blue text shows the casting tasking place.<\/p>\n<p><strong>Example<\/strong><\/p>\n<pre>Here an integer has been stored, but needs to be concatenated with 2 strings. It needs to be cast first\r\n\r\nprice = 5.23\r\n\r\nprint(\"The total cost of you shopping is \u00a3\" + <span style=\"color: #0000ff;\">str(price)<\/span> + \". Thankyou\")<\/pre>\n<\/div>\n<div class=\"arconix-pane pane-Quiz\">\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.101computing.net\/quiz\/DataTypes.html\" width=\"100%\" height=\"600px\"><\/iframe><\/p>\n<\/div>\n<div class=\"arconix-pane pane-Resources\">\n<p>Other Resources<\/p>\n<p><a href=\"https:\/\/www.bbc.com\/bitesize\/guides\/zc6s4wx\/test\">BBC Data Types Quiz<\/a><\/p>\n<p><a href=\"https:\/\/www.programiz.com\/python-programming\/quiz\/native-data-types\/take\">Python Data Types Quiz<\/a><\/p>\n<p><a href=\"https:\/\/play.kahoot.it\/#\/k\/70a3060f-b95f-4e90-8e1d-23ea3accfca1\">Kahoot<\/a><\/p>\n<p>(Replace with better kahoot with more questions)<\/p>\n<p>&nbsp;<\/p>\n<\/div><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Data Types - GCSE Computer Science Theory<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnlearn.uk\/gcsecs\/data-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Types - GCSE Computer Science Theory\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnlearn.uk\/gcsecs\/data-types\/\" \/>\n<meta property=\"og:site_name\" content=\"GCSE Computer Science Theory\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-13T09:42:31+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/data-types\/\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/data-types\/\",\"name\":\"Data Types - GCSE Computer Science Theory\",\"isPartOf\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#website\"},\"datePublished\":\"2018-11-12T17:37:13+00:00\",\"dateModified\":\"2018-11-13T09:42:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/data-types\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnlearn.uk\/gcsecs\/data-types\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/data-types\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"OCR GCSE Computer Science Home\",\"item\":\"https:\/\/learnlearn.uk\/gcsecs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data Types\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#website\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/\",\"name\":\"GCSE Computer Science Theory\",\"description\":\"Just another My Blog site\",\"publisher\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnlearn.uk\/gcsecs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#organization\",\"name\":\"GCSE Computer Science Theory\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png\",\"contentUrl\":\"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png\",\"width\":710,\"height\":98,\"caption\":\"GCSE Computer Science Theory\"},\"image\":{\"@id\":\"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data Types - GCSE Computer Science Theory","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learnlearn.uk\/gcsecs\/data-types\/","og_locale":"en_GB","og_type":"article","og_title":"Data Types - GCSE Computer Science Theory","og_url":"https:\/\/learnlearn.uk\/gcsecs\/data-types\/","og_site_name":"GCSE Computer Science Theory","article_modified_time":"2018-11-13T09:42:31+00:00","twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/learnlearn.uk\/gcsecs\/data-types\/","url":"https:\/\/learnlearn.uk\/gcsecs\/data-types\/","name":"Data Types - GCSE Computer Science Theory","isPartOf":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/#website"},"datePublished":"2018-11-12T17:37:13+00:00","dateModified":"2018-11-13T09:42:31+00:00","breadcrumb":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/data-types\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnlearn.uk\/gcsecs\/data-types\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnlearn.uk\/gcsecs\/data-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"OCR GCSE Computer Science Home","item":"https:\/\/learnlearn.uk\/gcsecs\/"},{"@type":"ListItem","position":2,"name":"Data Types"}]},{"@type":"WebSite","@id":"https:\/\/learnlearn.uk\/gcsecs\/#website","url":"https:\/\/learnlearn.uk\/gcsecs\/","name":"GCSE Computer Science Theory","description":"Just another My Blog site","publisher":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnlearn.uk\/gcsecs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/learnlearn.uk\/gcsecs\/#organization","name":"GCSE Computer Science Theory","url":"https:\/\/learnlearn.uk\/gcsecs\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/","url":"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png","contentUrl":"https:\/\/learnlearn.uk\/gcsecs\/wp-content\/uploads\/sites\/8\/2019\/02\/LearnLearnLogowhite.png","width":710,"height":98,"caption":"GCSE Computer Science Theory"},"image":{"@id":"https:\/\/learnlearn.uk\/gcsecs\/#\/schema\/logo\/image\/"}}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"learnlearnadmin","author_link":"https:\/\/learnlearn.uk\/gcsecs\/author\/learnlearnadmin\/"},"rttpg_comment":0,"rttpg_category":null,"rttpg_excerpt":null,"_links":{"self":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages\/665"}],"collection":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/comments?post=665"}],"version-history":[{"count":7,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages\/665\/revisions"}],"predecessor-version":[{"id":704,"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/pages\/665\/revisions\/704"}],"wp:attachment":[{"href":"https:\/\/learnlearn.uk\/gcsecs\/wp-json\/wp\/v2\/media?parent=665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}