Tag Archives: string

Variable Types in Python

Table of Contents for this Page Common Variable types Python’s built in [crayon-5f0a24c2858ae010480363-i/] function Naming Conventions for Variables (snake vs camel case) Python supports the basic types of variables that  you would expect from a general purpose language. These are listed below. Number floating point  integer String (more here) Boolean List (more on lists here) Dictionary Tuple Example … Continue reading Variable Types in Python →

String Loop AP CS A Practice Multiple Choose Question

Below is an AP styled multiple choice question involving involving a while loop over a string and the indexOf() method. What is the result of the call to the method [crayon-5f0a24c285f38824490133-i/] [crayon-5f0a24c285f42994998155-i/]  Error returns 1 infinite loop returns 3 returns 2   [crayon-5f0a24c285f46271130921/]   Scroll down  for answer.   The answer is [crayon-5f0a24c285f4a811569171-i/]  Error returns 1 infinite … Continue reading String Loop AP CS A Practice ...

Python Substrings- Multiple Letters

In our prior lesson on Python strings , we indicate looked at how to create a string and how to reference individual characters in string. Now, we’ll look at how to excerpt multiple characters from a string.  If you want to Python to talk about multiple letters, Python needs to know where to begin and where … Continue reading Python Substrings- Multiple Letters →