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
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
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
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
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
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
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
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
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
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
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
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
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
> ___
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
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
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
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
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
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
19 matches
Mail list logo