Re: [Tutor] Learn Python The Hard Way, Ex19-3

2012-02-14 Thread amt
Hello! I managed in the end to have more than 10 ways of doing it, moving now to Exercise 20. Thank you so much for helping me out every time. Regards, amt ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

Re: [Tutor] string integers?

2012-02-12 Thread amt
Hello William and welcome to the Python list. I'm a beginner but I'll give it a shot. Problem is, you use raw_input and it returns a string, not an int. Try this code: str1 = raw_input("Type in a String: ") str2 = raw_input("Type in a String: ") int1 = int(raw_input("Type in a integer variable:

[Tutor] Learn Python The Hard Way, Ex19-3

2012-02-11 Thread amt
far too many to enumerate.). So, what other ways are there aside the ones already presented in the above code? Thanks in advance, amt. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why do you have to close files?

2012-01-29 Thread amt
All the replies were very helpful! Thank you very much for helping me out! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Why do you have to close files?

2012-01-26 Thread amt
t;Alright, all done." output.close() input.close() I don't get it. If you don't close input and output it works exactly the same as if you would close them, so why do you have to do output.close() and input.close()? Also does it matter if you do: input.close() and then

Re: [Tutor] Are there other ways of solving this exercise?

2012-01-13 Thread amt
Wow!!! Thanks so much for your reply. It was so nicely written and I understood everything you said. Thanks again, have a nice weekend. Regards, Amt. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] Are there other ways of solving this exercise?

2012-01-12 Thread amt
I'll give it another try: On Thu, Jan 12, 2012 at 10:26 AM, Walter Prins wrote: > Hi amt, > > On 12 January 2012 15:11, amt <0101...@gmail.com> wrote: >> After reading from http://docs.python.org/library/stdtypes.html I came >> up with this: >> >> b

Re: [Tutor] Are there other ways of solving this exercise?

2012-01-12 Thread amt
On Thu, Jan 12, 2012 at 9:40 AM, Walter Prins wrote: > Hi, > > On 12 January 2012 14:24, amt <0101...@gmail.com> wrote: >> >> target.write("%s\n%s\n%s\n" %(line1, line2, line3)) >> >> This is the only method I was able to figure out of solving th

[Tutor] Are there other ways of solving this exercise?

2012-01-12 Thread amt
.truncate() print "Now I'm going to ask you for three lines." line1 = raw_input("line 1: ") line2 = raw_input("line 2: ") line3 = raw_input("line 3: ") print "I'm going to write these to the file." target.write("%s\n%s\n%

Re: [Tutor] Suggest Book

2011-11-12 Thread amt
h you good luck! Regards, amt. On Fri, Nov 11, 2011 at 4:29 PM, Pankaj Jakhar wrote: > Hello > > Please suggest me the best book for Python from which I can learn basics > to advanced Python. > > Thank you. >

Re: [Tutor] Other ways to use raw_input function

2011-10-19 Thread amt
Thanks a lot Alan for helping me out every time. Also thanks Wayne! Regards, amt. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Other ways to use raw_input function

2011-10-18 Thread amt
put("How much do you weigh? ") print "So, you're %r old, %r tall and %r heavy." % (age, height, weight) Are there any other ways of using it? If yes can you please give me a detailed example so I can understand. Thanks in advance, amt. ___

Re: [Tutor] What's the difference between %s and %r?

2011-07-26 Thread amt
Hello! Thank you all for writing and helping me out. I now understand the difference between the two format characters. -amt ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

[Tutor] What's the difference between %s and %r?

2011-07-23 Thread amt
Hello! I'm having troubles understanding what is the difference between %s and %r(format characters). I did google and found something on StackOverflow but I don't understand the explanation as it's not beginner orientated. Also, I have this code from learn python the hard way. Why at line 9 doe

Re: [Tutor] Floating point exercise 3 from Learn python the hard way

2011-06-14 Thread amt
Everything is clear now. Thank you for your replies. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Floating point exercise 3 from Learn python the hard way

2011-06-14 Thread amt
loating numbers except the fact to serve as an example that if I have a floating point number it affects the rest of the expression evaluation. So, should I keep them or not?It's unclear to me and sadly the author of the book doesn't provide the solutions to the exer

Re: [Tutor] Floating point exercise 3 from Learn python the hard way

2011-06-13 Thread amt
> > > Can you explain your reasoning? Why do you think line 3 needs > to be changed? Why line 5? Well the exercise says: "Rewrite ex3.py to use floating point numbers so it’s more accurate (hint: 20.0 is floating point)." I am honestly confused. I have read the exercise and found three lines tha

Re: [Tutor] Floating point exercise 3 from Learn python the hard way

2011-06-13 Thread amt
Hello, my version is Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39). The book only talks about Python 2.x. So, how do I solve the exercise? 3. print "Roosters", 100 - 25 * 3 % 4.00 5. print 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4.00 + 6 Is this correct? I'm a bit confused at line 5 because python return

[Tutor] Floating point exercise 3 from Learn python the hard way

2011-06-13 Thread amt
s of code and only line 3 and 5 needs to be changed. I came up with: print "Roosters", 100 - float(25) * 3 % 4 This is for line 3 so it is more precised. Is it correct what I did? What do I have to do for line 5? Thanks in advance! Regards, amt. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Non programmer wanting to become programmer

2011-05-27 Thread amt
Thank you all for the replies. They helped me a lot. Have a great weekend! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Non programmer wanting to become programmer

2011-05-26 Thread amt
ks in the Python for non programmers section are for python 2, Invent your own computer games with Python is version 3.) 3)Algorithms, memory management, data structures, when is the right time to learn them? Regards, amt. ___ Tutor maillist -