Questions concerning url.py: Exp: workingwithURL.py you should only need to use url.get_text() this returns a string Max and min from input list of numbers: exp: lines 3 - 19 reviewTest2018.py We have a list and we can look at every element in the list! Len of strings in a list: same logic as max and min but instead of casting to an int take the len within the for loop see 23 fall2017 (below) for exp Random A seed is just a value (such as a string or an integer) that will just determine the random output, so that so long as the seed is set to a certain seed, it will return the same output each time when using random. Take a look at the methods from the random module and know when to use when producing random values. You can look at whether or not you're working with numbers or lists and go from there when it comes to working with sequences as well. exp: lines 20 - 32 reviewTest2018.py indexing purpose: where an element is located in a sequence brackets acces the element at that index Lists: ['h', 1, True, 3] 'h' is at index 0 1 is at index 1 True is at index 2 3 is at index 3 Strings: 'Hello" H is at index 0 e is at index 1 l is at index 2 l is at index 3 o is at index 4 if you know the index of something you can acces it For loops aaaaaaahhh: For for loops, you want to go through different sequences. Some sequences include: - lists - strings - ranges How do you set up a for loop? Some examples are: for some_variable in sequence: for number in list_of_numbers: for every_element in list_of_elements: for every_character in string: for number in range(0,n): The iterator, the "variable" will go through your sequence and work with that specific "state" or value of that element/character/number at that given time while it's going through the for loop. You can name the iterator anything. for unicorn in range(0, 10): (but name it something useful!) for n in range(0,10): print(n) The compiler runs through all the code line by line before it hits the for loop and starts off with the first value of n in the for loop. It carries out everything in the for loop and continues onto the next value of n once it reaches the end of the indented statements in the for loop. n = 0 n = 1 n = ... all the way to 9 (10-1) for ch in "Hello": print(ch) This for loop prints each character in the string "Hello". Range is a short way of writing a list of numbers. The range tells you the first value (where you begin) and the last value (where you end) in a for loop. Ranges go from 0 to n-1 for a range (0,n) If a range is (0,n) it is going in mathematical notation [0,n) so includes the first value and everything up to and not including the last value (thus n-1). In a string, each character has an index. If we have string "hello" then we have indices, 0,1,2,3,4 corresponding to each character in the string. "Hello" you can think of a list of characters! (when running through a for loop as you loop through a string) Length and indices are a bit different. The length of "hello" is 5 but it goes from indices 0-4 because it starts at index 0. for x in ["Hi", "Ho"]: print(x) It will look at that first element "Hi" and then print that element and then look at second element "Ho" and print that element. The iterator is set to the first element and then the second and so on until it reaches the end. Nested Looping: !!!!!!! for x in ["H", 1, "oh", 3]: for y in [1, 2, 3]: print(x, y) when looking through the line of code, it will first print "H 1" then it will print out "H 3" and "H 4" and then since we are done with the loop with y it will go back up to the first for loop and x = 1 so y is again set equal to the first value so the next things printed to the console will be "1 1" , "1 3", and "1 4" and so on until going back up. It will go into the first for loop and then into the second for loop, run through that loop entirely, and then go back up into the first for loop and go on line by line until we are finished with the first for loop. Nested loops will be useful if you're looking at rows and columns or if you want to have one thing remain the same while doing more operations in another loop as the iterators in both loops changes as you run through code strings count and find .count(x) counts the number of occurences of whatever it passed into it. .find(x) finds the first occurence of whatever it passed into it. slicing Look at the module for str and look at the closed brackets splicing and ranges. Generally, s[i:j] will return a slice of the string from index i to j-1 and s[i] will return the character at index i. Boolean Logic - Booleans show up on past test - don't worry about it right now at all!! #23 Fall2017 reviewTest12018.py line 32 till end