Hey everyone! I'm a math student working on a short script involving
logs. I have a function on my scientific calculator, and was wondering
if there was a similar funtion in python.
For example:
(log65536)/(log4)= 8
I've searched around a bit and haven't been able to find anything.
Thanks!
-Christian 11 2489
Svens wrote: Hey everyone! I'm a math student working on a short script involving logs. I have a function on my scientific calculator, and was wondering if there was a similar funtion in python.
For example:
(log65536)/(log4)= 8
I've searched around a bit and haven't been able to find anything.
import math
--
Robert Kern rk***@ucsd.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Hey thanks...
Still getting an error message though. Here's what i'm doing:
------
import math
log10(15625)
------
-It says that log10 is not defined, but it is since the module is
imported, right?
Svens wrote: Hey thanks...
Still getting an error message though. Here's what i'm doing: ------ import math log10(15625) ------ -It says that log10 is not defined, but it is since the module is imported, right?
No, read the tutorial.
import math
math.log10(15625)
--
Robert Kern rk***@ucsd.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Svens wrote: Hey thanks...
Still getting an error message though. Here's what i'm doing: ------ import math log10(15625) ------ -It says that log10 is not defined, but it is since the module is imported, right?
try this:
import math
math.log10(15625)
On Jun 1, 2005, at 9:04 PM, Svens wrote: Hey thanks...
Still getting an error message though. Here's what i'm doing: ------ import math log10(15625) ------ -It says that log10 is not defined, but it is since the module is imported, right?
do either
import math
math.log10(15625)
from math import *
log10(15625)
from math import log10
log10(15625)
-- Elliot Temple http://www.curi.us/
---
[This E-mail scanned for viruses by Declude Virus]
Elliot Temple wrote: from math import * log10(15625)
It's always a good idea, especially when answering a beginner's
question, to add the caution that this form ("from xxx import *") has
certain dangers** associated with it, and is widely considered poor
style, and should really only rarely be used. (The math module is
probably one of the few places where some people make an exception,
however, but it's still not a good habit to get into.)
-Peter
> import math math.log10(15625)
To find out the names of function in the math module without checking the
docs, do dir(math) #same for any other module
To get more info, do
help(math) # same for any other module with a doc string
Terry J. Reedy
"Peter Hansen" <pe***@engcorp.com> wrote in message
news:Q7********************@powergate.ca... Elliot Temple wrote: from math import * log10(15625)
It's always a good idea, especially when answering a beginner's question, to add the caution that this form ("from xxx import *") has certain dangers** associated with it, and is widely considered poor style, and should really only rarely be used.
Which is why I often do things like import math as m m.log...
Peter Hansen wrote: It's always a good idea, especially when answering a beginner's question, to add the caution that this form ("from xxx import *") has certain dangers** associated with it, and is widely considered poor style, and should really only rarely be used.
Better still, don't even *mention* it to a beginner.
They don't need to know about it. At all. Really.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg
Greg Ewing wrote: Peter Hansen wrote:
It's always a good idea, especially when answering a beginner's question, to add the caution that this form ("from xxx import *") has certain dangers** associated with it, and is widely considered poor style, and should really only rarely be used.
Better still, don't even *mention* it to a beginner. They don't need to know about it. At all. Really.
Well, the OP's use is precisely why "from xxx import *" exists: the
interactive prompt.
--
Robert Kern rk***@ucsd.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Robert Kern wrote: Greg Ewing wrote:
[about the "from xxx import *" syntax] Better still, don't even *mention* it to a beginner. They don't need to know about it. At all. Really.
Well, the OP's use is precisely why "from xxx import *" exists: the interactive prompt.
In that case (and, really, any time) Terry's solution is quite suitable
and an excellent substitute. Even at the interactive prompt some of the
dangers (mostly the potential for name collisions) of "from xxx import
*" are still present.
-Peter This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: J.R. |
last post by:
Hi folks,
The python can only support passing value in function call (right?), I'm
wondering how to effectively pass a large parameter, such as a large list or
dictionary?
It could achieved...
|
by: Mike Malter |
last post by:
I am just starting to work with reflection and I want to create a log that saves relevant information if a method call fails so I
can call that method again later using reflection.
I am...
|
by: Neal |
last post by:
managed C++
VS 2003
I have a beginner question about windows forms....
I need to call a function when a certain limit has been reached, now with
the way VS sets up the .NET windows Form I get...
|
by: ^MisterJingo^ |
last post by:
Hi all,
I'm attempting to create a login/role system for an application i'm
building. My idea is to store an instance of a 'webapp' object in
global.asax. This object stores login (username, ID)...
|
by: Andy Leese |
last post by:
Beginner Question: ASCII Symbols
I am using Borland C++ and programming under DOS. I wish to display the
symbols of the early ASCII character set...
For example:
cout << char(7);
...
|
by: a |
last post by:
Dear all vb.net developer
I want to know the time I need to master vb.net?
I'm beginner
|
by: Daniel T. |
last post by:
Carter <cartercheng@gmail.comwrote:
When you see "discards qualifiers", more often than not, it means that a
const object is begin asked to do something that only non-const objects
can do....
|
by: Daniel |
last post by:
Looking for a good resource for beginners? books, online anything that will
get me started..
what im trying to focus on is building a small program in c# to look thru a
few files in a folder...
|
by: roanhn |
last post by:
Hello.
I've to to write a master's thesis. Currently I deal with php, mysql, ajax.
Fate decreed that I've to choose one of this subjects:
1.gdi+ library in .net technology
2.ado.net technology...
|
by: Rina0 |
last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |