-
Tuples
https://www.pythonlearn.com/html-008/cfbook011.html
-
Iterating over dictionaries using ‘for’ loops
https://stackoverflow.com/questions/3294889/iterating-over-dictionaries-using-for-loops
-
How to open a webpage and search for a word in python
https://stackoverflow.com/questions/1913871/how-to-open-a-webpage-and-search-for-a-word-in-python
-
How to split a string into a list?
https://stackoverflow.com/questions/743806/how-to-split-a-string-into-a-list
-
using the dir() Built-in function in Python programming
>>> import struct >>> dir() # show the names in the module namespace [‘__builtins__’, ‘__doc__’, ‘__name__’, ‘struct’] >>> dir(struct) # show the names in the struct module [‘Struct’, ‘__builtins__’, ‘__doc__’, ‘__file__’, ‘__name__’, ‘__package__’, ‘_clearcache’, ‘calcsize’, ‘error’, ‘pack’, ‘pack_into’, ‘unpack’, ‘unpack_from’] >>> class Shape(object): def __dir__(self): return [‘area’, ‘perimeter’, ‘location’] >>> s = Shape() >>> dir(s)…
-
How to write a program to solve project Euler problem 4
”’ This file is worked on from http://www.s-anand.net/euler.html , Solution of Problem 4 A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 x 99. Find the largest palindrome made from the product of two 3-digit numbers. ”’ n = 0 for…
-
Project Euler Problem 3, solution internals using python debugger
$python -m pdb euler-three.py > /home/jeffrin/beautifulwork/lib/euler-three.py(7)() -> ”’ (Pdb) r 6857 –Return– > /home/jeffrin/beautifulwork/lib/euler-three.py(17)()->None -> print n (Pdb) next –Return– > (1)()->None (Pdb) next The program finished and will be restarted > /home/jeffrin/beautifulwork/lib/euler-three.py(7)() -> ”’ (Pdb) next > /home/jeffrin/beautifulwork/lib/euler-three.py(9)() -> n = 600851475143 (Pdb) next > /home/jeffrin/beautifulwork/lib/euler-three.py(11)() -> i = 2 (Pdb) next > /home/jeffrin/beautifulwork/lib/euler-three.py(12)()…
-
Project Euler Problem 2, solution internals using python debugger
$python -m pdb project-euler-2.py > /home/jeffrin/beautifulwork/lib/project-euler-2.py(13)() -> ”’ (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(15)() -> cache = {} (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(16)() -> def fib(n): (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(20)() -> n = 0 (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(21)() -> i = 0 (Pdb) next > /home/jeffrin/beautifulwork/lib/project-euler-2.py(22)() -> while fib(i) /home/jeffrin/beautifulwork/lib/project-euler-2.py(23)() -> if not fib(i) % 2: n =…