Re: [Tutor] Calculate 4**9 without using **

2017-03-04 Thread Sri Kavi
Hi, I'm a beginner learning to program with Python. I'm trying to explain a solution in plain English. Please correct me if I'm wrong. Create a function that takes base and exponent as arguments. In the body of the function: set a result variable to the base. User a for-loop with a range

Re: [Tutor] Calculate 4**9 without using **

2017-03-05 Thread Sri Kavi
t): result = base for _ in range(1, exponent): result *= base return result Also, I'm still coming to grips with Python basics and programming in general, so I need your feedback. On Sun, Mar 5, 2017 at 4:26 AM, Alan Gauld via Tutor wrote: > On 04/03/17 16:17

Re: [Tutor] Calculate 4**9 without using **

2017-03-05 Thread Sri Kavi
range(1, exponent): result *= base return 1 / result Please share your thoughts. On Sun, Mar 5, 2017 at 7:37 AM, Alex Kleider wrote: > On 2017-03-04 08:17, Sri Kavi wrote: > > I'm a beginner learning to program with Python. I'm trying to explain a >> sol

Re: [Tutor] Calculate 4**9 without using **

2017-03-05 Thread Sri Kavi
ply made me think about all those conditions and try to see if I can make my previous function code a little better. I need your feedback please. Sri On Sun, Mar 5, 2017 at 7:37 AM, Alex Kleider wrote: > On 2017-03-04 08:17, Sri Kavi wrote: > > I'm a beginner learning to program wit

Re: [Tutor] Calculate 4**9 without using **

2017-03-06 Thread Sri Kavi
you for being so helpful. On Sun, Mar 5, 2017 at 11:33 PM, Alex Kleider wrote: > On 2017-03-05 02:24, Peter Otten wrote: > >> Sri Kavi wrote: >> >> Like I just said in my other message, I was trying to reply to Tasha >>> Burman, but I was in digest mode and I di

Re: [Tutor] Calculate 4**9 without using **

2017-03-06 Thread Sri Kavi
53 PM, Alex Kleider wrote: > On 2017-03-05 23:52, Sri Kavi wrote: > > > > This version deals with both negative and non-negative exponents in a >> single loop. I like this. >> def power(base, exponent): >> """ Returns base**exponent. &q

Re: [Tutor] Calculate 4**9 without using **

2017-03-06 Thread Sri Kavi
53 PM, Alex Kleider wrote: > On 2017-03-05 23:52, Sri Kavi wrote: > > > > This version deals with both negative and non-negative exponents in a >> single loop. I like this. >> def power(base, exponent): >> """ Returns base**exponent. &q

[Tutor] Lists of duplicates

2017-03-08 Thread Sri Kavi
As part of my learning, I was participating in a discussion at: https://discuss.codecademy.com/t/python-lists-of-duplicated-elements/78151 It’s about making a function that returns a list of lists, with each list being all of the elements that are the same as another element in the original l

Re: [Tutor] IMAP Login Error - raise self.error(dat[-1])

2017-03-09 Thread Sri Kavi
Must be firewall that’s causing the problem? Here’s a third-party IMAP client library called IMAPClient which is easier to use . You may want to take a look at it. http://imapclient.readthedocs.io/en/stable/ Sri On Thu, Mar 9, 2017 at 11:35 AM, Sreekul Nair wrote: > Dear All, > > I have t

Re: [Tutor] Help!! Code ridden with Bugs

2017-03-09 Thread Sri Kavi
def checkout(self, cash_paid): self.cash_paid = cash_paid if self.cash_paid < self.total: self.total -= self.cash_paid return self.total return "Cash paid is not enough" You cannot return two values. Sri On Thu, Mar 9, 2017 at 6:58 PM, Eloka Chima via Tutor wrot

Re: [Tutor] tiny, little issue with list

2017-03-21 Thread Sri Kavi
Hi Rafael, LogActivities = [] prompt = ("What have you done today? Enter 'quit' to exit. ") while True: activity = input(prompt) # Do this here so 'quit' is not appended to the list if activity == 'quit': # To get out of the loop break # If still in the loop, append t

Re: [Tutor] CSV file Reading in python

2017-03-22 Thread Sri Kavi
Hi, Reading (and processing and writing) CSV files https://github.com/slott56/introduction-python-csv/blob/master/README.md On Mar 22, 2017 06:18, "Edzard de Vries" wrote: I have a CSV which I want to be able to read in Python. I don't know the exact syntax and I get error messages. Where c

Re: [Tutor] HTML module for Python

2017-03-22 Thread Sri Kavi
Hi, Please take a look at https://pypi.python.org/pypi/html On Mar 22, 2017 06:24, "ਪੰਜਾਬ ਪੰਜਾਬੀ" wrote: > Hi > > Looking for recommendations on Python module to use to generate HTML > pages/tables, other HTML content. Kindly help. > > Regards > Ni > ___

Re: [Tutor] Function question

2017-03-25 Thread Sri Kavi
On Sat, Mar 25, 2017 at 3:31 PM, Peter O'Doherty wrote: > > def myFunc(num): > for i in range(num): > print(i) > > print(myFunc(4)) > 0 > 1 > 2 > 3 > None #why None here? > > Because there are two print() functions, one inside the function and another outside. When a function does not

Re: [Tutor] How do we create a GUI to run a simple calculation program in Python?

2017-04-04 Thread Sri Kavi
On Tue, Apr 4, 2017 at 10:25, Lisa Hasler Waters wrote: > Hello Tutor, > > A middle school student of mine created a program to calculate simple and > compound interest. He built it in PyCharm EDU using a Mac running 10.11.6. > > He would like to create a GUI to run this program. Please, can you a

Re: [Tutor] How do we create a GUI to run a simple calculation program in Python?

2017-04-15 Thread Sri Kavi
On Wed, Apr 5, 2017 at 12:42 AM, Alan Gauld via Tutor wrote: > On 04/04/17 17:55, Lisa Hasler Waters wrote: > > > A middle school student of mine created a program to calculate simple and > > compound interest. He built it in PyCharm EDU using a Mac running > 10.11.6. > > > > He would like to cre

Re: [Tutor] Using Modules

2017-04-15 Thread Sri Kavi
Hi, Start with the tutorial at https://docs.python.org/3/tutorial/ It includes Brief Tour of the Standard Library: https://docs.python.org/3/tutorial/stdlib.html https://docs.python.org/3/tutorial/stdlib2.html Hope that helps. Sri On Sat, Apr 15, 2017 at 2:03 PM, Aero Maxx D wrote: > Hi ev

Re: [Tutor] intro book for python

2017-09-01 Thread Sri Kavi
I would choose to learn from The Python Tutorial: https://docs.python.org/3/tutorial/ On Sep 1, 2017 23:06, "Derek Smith" wrote: Hello! I am new to python coming from a Perl and Unix Admin background. I reviewed the site https://wiki.python.org/moin/IntroductoryBooks and would like to know

Re: [Tutor] Python 3 for Beginners was: (Re: intro book for python)

2017-09-03 Thread Sri Kavi
Hi guys, this mailing list is for people trying to learn Python and this list is here to help us all. It’s one of the hundreds of programming languages in use today. Use it as a tool and see if it can help you accomplish your goal. If it fails to serve you, you’ve so many choices. Every language h