Re: [Tutor] Python programming help!

2018-09-23 Thread V E G E T A L
Wow, didn't know attachments didn't work. I had posted my screenshot as an
attachment, never expected you to read my mind. I solved the problem, it
was a spelling mistake (I know, I'm stupid). Thank a lot though!

Στις Κυρ, 23 Σεπ 2018 - 16:25 ο χρήστης Bob Gailer 
έγραψε:

> On Sep 23, 2018 3:33 AM, "V E G E T A L" 
> wrote:
> >
> > Hello folks! So, I'm pretty much a noob still experimenting with basic
> > commands. I wanted to make a code that checks if the value of one
> variable
> > is less, equal or greater than the other. Pretty simple right? But then,
>
> > this problem emerged.
>
> What problem? I don't see any problem here. If you provided an attachment
> this email list does not forward attachments.
>
> The proper way is to copy and paste directly into the body of the email.
>
> If you did not attempt to show us the problem, why? You certainly can't
> expect us to read your mind.
>
> I would really love some help, since I'm stuck and
> > can't figure out what I've done wrong.
> >
> > PS: I'm using Anaconda and JupyterNotebook.
> > ___
> > Tutor maillist  -  Tutor@python.org
> > To unsubscribe or change subscription options:
> > https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python programming help!

2018-09-23 Thread Carlton Banks
Without having Seen the code, use og statements.. but please provide is the
code...

søn. 23. sep. 2018 15.26 skrev Bob Gailer :

> On Sep 23, 2018 3:33 AM, "V E G E T A L" 
> wrote:
> >
> > Hello folks! So, I'm pretty much a noob still experimenting with basic
> > commands. I wanted to make a code that checks if the value of one
> variable
> > is less, equal or greater than the other. Pretty simple right? But then,
>
> > this problem emerged.
>
> What problem? I don't see any problem here. If you provided an attachment
> this email list does not forward attachments.
>
> The proper way is to copy and paste directly into the body of the email.
>
> If you did not attempt to show us the problem, why? You certainly can't
> expect us to read your mind.
>
> I would really love some help, since I'm stuck and
> > can't figure out what I've done wrong.
> >
> > PS: I'm using Anaconda and JupyterNotebook.
> > ___
> > Tutor maillist  -  Tutor@python.org
> > To unsubscribe or change subscription options:
> > https://mail.python.org/mailman/listinfo/tutor
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python programming help!

2018-09-23 Thread Bob Gailer
On Sep 23, 2018 3:33 AM, "V E G E T A L" 
wrote:
>
> Hello folks! So, I'm pretty much a noob still experimenting with basic
> commands. I wanted to make a code that checks if the value of one variable
> is less, equal or greater than the other. Pretty simple right? But then,

> this problem emerged.

What problem? I don't see any problem here. If you provided an attachment
this email list does not forward attachments.

The proper way is to copy and paste directly into the body of the email.

If you did not attempt to show us the problem, why? You certainly can't
expect us to read your mind.

I would really love some help, since I'm stuck and
> can't figure out what I've done wrong.
>
> PS: I'm using Anaconda and JupyterNotebook.
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python programming help!

2018-09-23 Thread Mark Lawrence

On 21/09/18 16:12, V E G E T A L wrote:

Hello folks! So, I'm pretty much a noob still experimenting with basic
commands. I wanted to make a code that checks if the value of one variable
is less, equal or greater than the other. Pretty simple right? But then,
this problem emerged. I would really love some help, since I'm stuck and
can't figure out what I've done wrong.

PS: I'm using Anaconda and JupyterNotebook.


Please post your code as there are some smart people on this list but 
we're not mind readers :)  Also state your OS and the Python version.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: [Tutor] Python Programming Help

2013-09-11 Thread Amit Saha
On Wed, Sep 11, 2013 at 7:59 PM, Oscar Benjamin
 wrote:
> On 11 September 2013 10:48, Amit Saha  wrote:
>> Hi Katie,
>>
>> So, before you write the solution to the programming problem above,
>> can you first try to write a program and then run it?  What operating
>> system are you working? If you are on Windows, can I suggest you to
>> take a look at these videos I created a while back and they may help
>> you:  http://www.youtube.com/playlist?list=PLD0rs_vnIQS5r8IhNpu0rWIAyKpTX34yo
>
> Good work Amit. I don't have any sound on this machine but I skimmed
> those videos and they seem really useful. I'll remember to point
> someone there in future. Do you know of anything similar for OSX?

Thanks, Oscar. I haven't really seen something similar for OSX, mainly
because I have never used one. I searched now though on YouTube and
there seems to be a few.




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


Re: [Tutor] Python Programming Help

2013-09-11 Thread Oscar Benjamin
On 11 September 2013 10:48, Amit Saha  wrote:
> Hi Katie,
>
> So, before you write the solution to the programming problem above,
> can you first try to write a program and then run it?  What operating
> system are you working? If you are on Windows, can I suggest you to
> take a look at these videos I created a while back and they may help
> you:  http://www.youtube.com/playlist?list=PLD0rs_vnIQS5r8IhNpu0rWIAyKpTX34yo

Good work Amit. I don't have any sound on this machine but I skimmed
those videos and they seem really useful. I'll remember to point
someone there in future. Do you know of anything similar for OSX?


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


Re: [Tutor] Python Programming Help

2013-09-11 Thread Alan Gauld

On 11/09/13 02:01, Katie wrote:

I am a beginner in computer programming.


Hi welcome to the tutor list.


I am currently trying to write a program in Python version 2.7.5 *that
uses the math module to compute sinh(x) = 1/2(e^x - e^(-x)) in three
ways for a given value of x:*
*1a) by using the sinh function*
*1b) by using the exp function*
*1c) by using the value of e and the exponentiation operator



So, I know that I have to create a NotePad file so that I can import
that into my command prompt.


You don;t need to import it into the command prompt although
you may for that for testing purposes. But you can run Python
programs directly by double clicking them in your file explorer.

It will help if you tell us which version of Python you are using and 
which Operating System you use. (I'll assume Windows in this post

since you mention Notepad)

Finally, Notepad is fine for short text notes but it's not good for 
programming. You should get a proper programer's editor. IDLE comes

with Python in most cases and if you are using Windows and download
the ActiveState version of Python you will also get Pythonwin.
Either of those will be better than Notepad for writing code.


In my NotePad file, I have the following...I'm not sure if I am even
going about doing this problem correctly...

def sinh(x):
 return (1/2)*(e^x - e^(-x))


The ^ sign does not do what you think in Python. The operator you
need is ** (or use the pow() function).

Also e is not defined directly, it's in the math module so you
need to import math and then reference it as math.e
Alternatively, import e from math:

>>> from math import e,exp   # import e and exp() from math

And then use them directly:

>>> import math
>>> math.exp(3)
20.085536923187668

or

>>> from math import e,exp
>>> exp(3)
20.085536923187668


I am stuck, and don't know where to go from here. I would appreciate
help please.


You have defined your first version of sinh() you now need to fix
and test it. You can either import it into your python session

>>> import sinh# assuming the file is called sinh.py
>>> sinh.sinh(5)   # remember to include the module name as a prefix

or

You could call the function in your file and run it by clicking in 
explorer. To do that you should add to the end of your file:



print( sinh(2) )   # use any test value you wish...
input('Hit enter to quit')  # pauses output so you can see it


If you are comfortable using the OS command prompt you can also
run it from there with

C:\PATH\TO\YOUR\FILE> python sinh.py

This has the advantage that you will see any error messages too.

Finally, if you use IDLE or Pythonwin you can run the
program from inside those tools using the menus. At this stage
that's probably the best option. You can get a video tutorial
on using IDLE here:

http://www.youtube.com/watch?v=bOvqYw1SZJg


HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

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


Re: [Tutor] Python Programming Help

2013-09-11 Thread Amit Saha
Hi Katie,

On Wed, Sep 11, 2013 at 11:01 AM, Katie  wrote:
> Hello,
>
> I am a beginner in computer programming. I am studying math, and the math
> class that I will be taking requires knowledge in Python. So, I am in a
> computer science class. Therefore, I do not have an in-depth knowledge of
> computer programming.

Welcome to the forum and welcome to the world of programming!

>
> I am currently trying to write a program in Python version 2.7.5 that uses
> the math module to compute sinh(x) = 1/2(e^x - e^(-x)) in three ways for a
> given value of x:
> 1a) by using the sinh function
> 1b) by using the exp function
> 1c) by using the value of e and the exponentiation operator **
>
> 2. Print the results and note any differences that appear.
>
> So, I know that I have to create a NotePad file so that I can import that
> into my command prompt.
>
> In my NotePad file, I have the following...I'm not sure if I am even going
> about doing this problem correctly...

Okay, so when you are programming, there are two things you do to see
the result of your programs:

1. First, you write the program. You write this in an text editor.
Notepad is a text editor (There are better options, but let's keep it
as it is for now)
2. Then, you run the program. Sometimes you can run the program from
the editor itself, such as in IDLE. Other times, you have to run it
separately.

So, before you write the solution to the programming problem above,
can you first try to write a program and then run it?  What operating
system are you working? If you are on Windows, can I suggest you to
take a look at these videos I created a while back and they may help
you:  http://www.youtube.com/playlist?list=PLD0rs_vnIQS5r8IhNpu0rWIAyKpTX34yo

Only when you have written your first program, which is really simple,
you should try to attempt your exercise.

Hope that helps.

-Amit.


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


Re: [Tutor] Python Programming Help

2013-09-11 Thread Chris Down
On 2013-09-10 21:01, Katie wrote:
> In my NotePad file, I have the following...I'm not sure if I am even going
> about doing this problem correctly...

I don't envy you having to use notepad. Consider using a more sane editor...
you'll thank yourself for it.

> def sinh(x):
> return (1/2)*(e^x - e^(-x))
> def exp(x):
> return e**x
>
> I am stuck, and don't know where to go from here. I would appreciate help 
> please.

You'd have done well to present the problem you're having, but you should know
that ^ is XOR (as it is in most programming languages), you probably want **
(and space out your function definitions -- PEP8 says to use two blank lines
between functions).


pgp_uNjpYYMed.pgp
Description: PGP signature
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor