[Tutor] Starting over with Python

John Carmona jeannot18 at hotmail.com
Thu Dec 14 02:08:09 CET 2006


After quite a while away from Python, I have decided to re-study Python. I 
am interested to learn Python to support my love for Cryptography. I have a 
first very easy question (did some search on Google but could not find 
anything helpful). I realise that this is very basic so be gentle with me.

If i insert the following script:

-------------------------------------------------------------------------------------------------
odd =1
>>>while odd <=100:
	if (odd%2)==1:
		print odd
	odd = odd + 1
-------------------------------------------------------------------------------------------------
I get a list of the odd numbers from 1 to 99. But now if I wanted to add 
those number together (i.e. 1 + 3 +5 + 7 etc.), what line of coding should I 
include? I have tried to add "odd + odd" but it did not work. In advance 
thanks.

If anyone could direct me to some site where python is associated with 
Cryptography I would be very grateful. Many thanks
JC

_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters! 
http://www.msn.co.uk/newsletters



More information about the Tutor mailing list