Python if statements http://docs.python.org/tutorial/controlflow.html#if-statements if Statements¶ Perhaps the most well-known statement type is the if statement. For example: >>>>>> x = int(raw_input("Please enter an integer: ")) Please enter an integer: 42 >>> if x Programming 2012.05.29
Project Euler Problem 14 Problem 14 05 April 2002 The following iterative sequence is defined for the set of positive integers: n n/2 (n is even) n 3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence: 13 40 20 10 5 16 8 4 2 1 It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is tho.. Project Euler 2012.05.29
How do I generate random numbers in Python? http://effbot.org/pyfaq/how-do-i-generate-random-numbers-in-python.htm How do I generate random numbers in Python? The standard random module implements a random number generator. Usage is simple:import random print random.random() This prints a random floating point number in the range [0, 1) (that is, between 0 and 1, including 0.0 but always smaller than 1.0). There are also many other specia.. Programming 2012.05.29
Project Euler Problem 13 Problem 13 22 March 2002 Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 91942213363574161572522430563301811072406154908250 23067588207539346171171980310421047513778063246676 892616706966236338201363784183.. Project Euler 2012.05.29
Project Euler Problem 12 Problem 12 08 March 2002 The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven triangle numbers: 1: 1 3: 1,3 6: 1,2,3,6 10: 1,2,5,10 15: 1,3,5,15 21: 1,3,7,21 28: 1,2,4,7,14,28 We can see that .. Project Euler 2012.05.29
Project Euler Problem 11 Problem 11 22 February 2002 In the 2020 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 2.. Project Euler 2012.05.29
Flute Vibrato http://www.flutetunes.com/articles/vibrato/ Flute VibratoVibrato is that shimmery variation in pitch that warms up the tone of the flute. It is similar to the effect produced by a violinist's hand as it moves back and forth. As Sir James Galway wrote in his book Flute,Vibrato is another subject on which experts violently disagree, and all of them are right. If one thing rather than another expre.. Music 2012.05.29
Python is Cool (and Perl is not), Especially for C/C++ Programmers http://www.strombergers.com/python/ Programming 2012.05.29
Is it possible to implement a Python for range loop without an iterator variable? http://stackoverflow.com/questions/818828/is-it-possible-to-implement-a-python-for-range-loop-without-an-iterator-variable Programming 2012.05.29
PyDev - a Python IDE for Eclipse http://pydev.org/ PyDev is a Python IDE for Eclipse, which may be used in Python, Jython and IronPython development.It comes with many goodies such as:Django integrationCode completionCode completion with auto importSyntax highlightingCode analysisGo to definitionRefactoringMark occurrencesDebuggerRemote debuggerTokens browserInteractive consoleUnittest integrationCode coverageand many others: h.. Programming 2012.05.28