{"id":2131,"date":"2018-10-08T13:15:31","date_gmt":"2018-10-08T12:15:31","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/?p=2131"},"modified":"2018-10-08T13:16:16","modified_gmt":"2018-10-08T12:16:16","slug":"higher-random-number-array-function","status":"publish","type":"post","link":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/2018\/10\/08\/higher-random-number-array-function\/","title":{"rendered":"Higher &#8211; Random Number Array Function"},"content":{"rendered":"<p>The class was asked to create a function that generated 100 number dice throws and stored them in an array.<\/p>\n<p>This function is used to create an array of random integers. The size of the array and the magnatude of the values is set when the function is called.<\/p>\n<pre class=\"brush: python; title: Array of Random Numbers Function; notranslate\" title=\"Array of Random Numbers Function\">\r\n\r\ndef randomNumbers(size,min,max):\r\n    # creates an array of (size) random numbers between min and max\r\n    import random\r\n    numbers=&#x5B;]\r\n    for loop in range(size):\r\n        numbers.append(random.randint(min,max))\r\n    return numbers\r\n\r\nrndNumbers=randomNumbers(100,1,6)\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The class was asked to create a function that generated 100 number dice throws and stored them in an array. This function is used to create an array of random integers. The size of the array and the magnatude of the values is set when the function is called. def randomNumbers(size,min,max): # creates an array &hellip;<\/p>\n","protected":false},"author":32,"featured_media":1386,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[432098,17932,17933],"tags":[],"class_list":["post-2131","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-higher","category-computational-constructs","category-data-types-and-structures"],"jetpack_featured_media_url":"https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/09\/Slide4.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/2131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/comments?post=2131"}],"version-history":[{"count":4,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/2131\/revisions"}],"predecessor-version":[{"id":2135,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/2131\/revisions\/2135"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/media\/1386"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/media?parent=2131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/categories?post=2131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/tags?post=2131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}