When we’re writing a program to solve a problem, it’s often helpful to write a program that answers an easier version of the problem first. How might we do that? What might that code look like? Now, say we want to ask the user for data elements to go in the first five elements in this array and then we want to save these values into their corresponding positions in the array. Let’s create a new program called lists() with an empty array in it called mylist. Instead of starting with a pre-made array (as we’ve done previously), let’s consider how we could write a program where the user provides the values that will be stored to the array. Let’s dig deeper into commands we can use to do even more with arrays. In the last blog post in this series, we learned how to create an array and then edit its elements. Work along with this blog post by downloading the following materials:Īlso, you’ll want to have the following handy: Use operations to analyze lists and their elements.Perform operations on lists and their elements and,.In this post, we will operate on lists (also known as arrays) and their elements, then use these operations to analyze lists and their elements. This post extends the Teaching Foundations of Computer Science with Python on TI-Nspire™ Technology workshop to study additional topics from Computer Science with the support of TI-Nspire II Python coding technology.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |