Posts

Showing posts from December, 2017

Iterating over the characters in a string: BEHIND THE SCENES!

Image
Welcome! Hi! Welcome to this short tutorial! We will discuss how to iterate over the character in a string, a very important concept for the course and you Computer Science journey. Syntax On the diagram below you can see the  general syntax  for iterating over the  items contained in an iterable  (strings are iterables and their “items” are the individual characters they contain) Ready? Set! Go! Once we start out for loop, the variable we’ve defined to be used in the for loop (in this case,  char ) will be updated on each iteration (see code in the "output" column on the diagram below). What does this mean? When the loop is run first time,  char ’s value will be  H . When the loop runs for the second time,  char ’s value will be  e And so on! The loop will run  as many times as the number of characters in the string  and the variable  char  will update its value wherever you’ve used it inside the loop. In this case, we’ve printed its value. As

How to read Python's Documentation: BEHIND THE SCENES!

Image
Welcome! Hi! Welcome to this section where we will dive into a “tool” that you will use and learn to love throughout your Computer Science journey and/or career. Let’s say you’ve found the Build-in Python function  round()  and you would to know more about how it works. What do you do? You go to  PYTHON'S DOCUMENTATION! Concept: First of all, let’s start by describing what is Documentation: Importance and First Impressions As you can see, it is extremely important since it tells you how a software (or in this case, a programming language) can be used. At first it may seem daunting and you will find a lot of technical terminology you maybe haven’t heard of next to the information you actually need, but don’t worry, through experience you will learn to determine what is relevant to your needs and what isn’t. Trust me, I’ve been through this and at first I felt like documentation was very intimidating but with practice I learned to love it because it