[Tutor] Need a mentor, Any help would be great

2013-03-01 Thread bessenkphilip

Hello,

 I'm just  a newbie in python and it would be great if someone could 
help me in this. I don't know where to start, I'd like to contribute to 
small opensource projects too which will help me to learn more in python.


Thanks & Regards,

 -Bessen
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Need a mentor, Any help would be great

2013-03-02 Thread bessenkphilip

Hello,

 Thanks for the "Welcome". I'm now working as a System admin in Linux 
that too a Junior level (L1, only coming to a 6 months in experience). 
I've got 2 to 3 hrs a day to learn python.


I've programmed a little bit before like our college staff given us a 
challenge to display letter format for any number given as input(upto 9 
digit). I've done that using C language. I think i know some basics in 
C, C++ and a little bit java(like small programs which explains concepts 
of class and objects).  I'd love to program something real that too in 
python.


The system i'm working is Ubuntu 11.04 and the python version is Python 
2.7.1+


I'd love to work on something (as i don't know about the specific types) 
real :)


Thanks again,
 -Bessen



On 03/02/2013 01:46 PM, Alan Gauld wrote:

On 02/03/13 04:06, bessenkphilip wrote:

  I'm just  a newbie in python and it would be great if someone could
help me in this.


Welcome,  treat this mailing list as a virtual 'someone'.

> I don't know where to start,

Tell us something about your background.

What level of computer skill do you have? Basic user, sysadmin? etc
Have you programmed before? In what languages?
What OS and Python version are you using?
What kind of programs would you like to work on?

There are Python tutorials for every level and style, its just
a matter of choosing to the right one for you. Then work through
one of them and ask questions here.


I'd like to contribute to small opensource projects

> too which will help me to learn more in python.

That's a good goal, especially once you get past the beginner stage
Start with SourceForge and search for Python projects.



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Need a mentor, Any help would be great

2013-03-03 Thread bessenkphilip

Hello,
 Thank you very much for the help
-Bessen
On 03/03/2013 01:59 PM, Alan Gauld wrote:

On 03/03/13 01:48, bessenkphilip wrote:


  Thanks for the "Welcome". I'm now working as a System admin in Linux
I've got 2 to 3 hrs a day to learn python.


In that case I'd start with the official tutorial on python.org.
Its targeted at people with a little bit of programming experience 
moving to Python.


It's also fairly *nix biased and relevant for sys admin type tasks.


The system i'm working is Ubuntu 11.04 and the python version is Python
2.7.1+


OK, that's a good solid platform. Once you have done the tutorial try 
automating some of the tasks you don on a regular basis as a first 
project.


Once comfortable go to SourceForge and find something in Python you 
can contribute too. Testing and Bug fixing is often a good place to 
start.





___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Doubt in for loop

2013-04-03 Thread bessenkphilip

Hi all,

I'm having a doubt in the below program's 2n'd "for" loop.

>>> for n in range(2, 10):
... for x in range(2, n):
... if n % x == 0:
... print n, 'equals', x, '*', n/x
... break
... else:
... # loop fell through without finding a factor
... print n, 'is a prime number'
...
2 is a prime number
3 is a prime number
4 equals 2 * 2
5 is a prime number
6 equals 2 * 3
7 is a prime number
8 equals 2 * 4
9 equals 3 * 3

My doubt is that "will 'x' be always of value 2, if so why that for loop 
"for x in range(2, n):"
i don't know how the first output , as If 2%2==0:(this satisfies the if 
loop as x =2) , so how the else part came to output i.e 2 is a prime number.


Please educate me in this.

Thanks in advance,
 -Bessen
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Doubt in for loop

2013-04-04 Thread bessenkphilip

On 04/04/2013 08:23 AM, Dave Angel wrote:

On 04/03/2013 09:53 PM, Steven D'Aprano wrote:

On 04/04/13 12:29, bessenkphilip wrote:

Hi all,

I'm having a doubt in the below program's 2n'd "for" loop.


for n in range(2, 10):

... for x in range(2, n):
... if n % x == 0:
... print n, 'equals', x, '*', n/x
... break
... else:
... # loop fell through without finding a factor
... print n, 'is a prime number'
...
2 is a prime number
3 is a prime number
4 equals 2 * 2
5 is a prime number
6 equals 2 * 3
7 is a prime number
8 equals 2 * 4
9 equals 3 * 3

My doubt is that "will 'x' be always of value 2, if so why that for
loop "for x in range(2, n):"
i don't know how the first output , as If 2%2==0:(this satisfies the
if loop as x =2) , so how the else part came to output i.e 2 is a
prime number.


I'm sorry, I don't understand your question.

x is *not* always of value 2. You can see with the last line,

9 equals 3 * 3

x has value 3.


The outer loop just checks 2, 3, 4, ... 9 to see whether they are prime.
The inner loop actually does the checking:


for x in range(2, n):
 if n % x == 0:
 print n, 'equals', x, '*', n/x
 break


This tests whether n is divisible by 2, 3, 4, 5, 6, ... up to n-1. If n
is divisible by any of those numbers, then n cannot be prime.

For example, with n = 9, the inner loop does this:

x = 2
Test if 2 is a factor: does 9/2 have remainder zero? No.
x = 3
Test if 3 is a factor: does 9/3 have remainder zero? Yes.
So 9 is not prime, and 9 = 3 * (9/3) = 3 * 3


If we test it with n = 35, the inner loop would do this:

x = 2
Test if 2 is a factor: does 35/2 have remainder zero? No.
x = 3
Test if 3 is a factor: does 35/3 have remainder zero? No.
x = 4
Test if 4 is a factor: does 35/4 have remainder zero? No.
x = 5
Test if 5 is a factor: does 35/5 have remainder zero? Yes.
So 35 is not prime, and 35 = 5 * (35/5) = 5 * 7



Notice that this does more work than necessary! Can you see what work it
does that is unnecessary?

(Hint: what even numbers are prime?)






I don't understand the questions either, but I can point out one thing 
that might be puzzling the OP:


When n is 2, the inner loop does nothing, it just skips to the else 
clause.  The reason is that range(2,2) is a null iterator. range(i,j) 
produces values from i to j-1, or to put it another way values for which

   i <= n < j

If i and j are identical, there's nothing to match it.


Thank you  very much Steven for explaining this. Yes,Dave, i was having 
doubt how n=2 came to else part, cleared that too, thank you .


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Coursera Python Course starts today

2013-08-20 Thread bessenkphilip
Thank you. need to check out. Me too completed first 2 weeks but haven't 
completed the full course.

 -Bessen

On 08/20/2013 05:32 AM, Leam Hall wrote:

Hey all,

In case I'm not the absolute last person to know, the newest edition 
of the Coursera "Learn to Program" course started today. It is Python 
based, free, lasts 7 weeks, and pretty fun. I didn't get a certificate 
last time as life got in the way. Hope to succeed this time.


https://class.coursera.org/programming1-002/class/index

Leam




___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor