On Thu, Jul 21, 2016 at 11:30 PM, Alan Gauld via Tutor wrote:
>
> Forwarding to list. Please use reply-all when responding to tutor messages.
>
> As Danny suggested this is quite a complex problem. I wasn't sure whether
> it was just the programming or the bigger algorithm issue you were stuck on.
On Jul 23, 2016 9:27 AM, "monik...@netzero.net"
wrote:
>
> IM sorry I do not understand:
>
> For array A of length N, and for an integer k < N:
> -- By k do you mean value of k or position of k in the list?
>
The letter 'k' is typically intended to be used as an index, a position
into a list. I'
> You probably want to use a problem that has fewer moving parts. Your
instructor likely has a much nicer introductory problem so that you can
learn the patterns of thinking through these problems.
Just to add: there are online resources you can use for this. Khan
Academy, for example:
https://w
On Sun, Jul 24, 2016 at 4:30 PM, monik...@netzero.net
wrote:
> Thank you all for your answers. I do not have a teacher or any body else who
> could guide me. I have taken all python classes offered in my area and many
> on line.
> The question is one of questions asked by interviews for a qa pos
> You will see a problem being explained that you should be *very*
> interested in. :) Here's a link just to give you a taste:
>
> https://youtu.be/0yjebrZXJ9A?t=3m
>
>
> I hope that this helps point you in the right direction. Good luck!
He has some more recent videos from 2012:
htt
> One area that is especially troublesome is knowledge of
> math. Programming is rooted in math and professional
> programmers will have studied math in depth but many
> amateur beginners may only have junior school math
> level. But how do you find out?
>
> It's a perennial problem when experts tr
On Mon, Aug 1, 2016 at 8:18 AM, Justin Korn via Tutor wrote:
> To whom it may concern,
> I need someone to help me to develop programs for the following assignments.
You've asked a few questions earlier:
https://mail.python.org/pipermail/tutor/2016-July/109403.html
https://mail.python.
I agree with Steven; JSON is probably one of the most popular formats
for saving structured data externally, and it's probably the
lightweight approach to use in this situation.
By the way, it looks like you're already dealing with a certain file
format in your program. In fact, it looks like a s
One other thing: you might hear another popular approach is to use the
"pickle" module. I don't think it'd be appropriate for your situation
because it would be overkill for the problem you're describing. JSON
is safer: if you have to choose between JSON and pickle, use JSON.
---
More curmudgeo
On Tue, Aug 2, 2016 at 7:59 AM, Chris Clifton via Tutor
wrote:
> My Logic: Since a string is immutable, I converted it to a list to separate
> out the characters and keep them in order. Idea is to change the case of the
> characters in the list then run a join to convert it back to a string.
> Based on both replies I got, JSON is what I will use.
>
> I do need the keys in the dictionary to be numerals, specifically they are
> integers.
>
> I believe after I load a stored pt_table, I can use this script to convert
> the keys back to integers.
>
> pt_table = dict((int(key), value) for
On Sun, Aug 28, 2016 at 7:46 AM, shahan khan wrote:
> Hello
> I'm teching myself Python using MIT opencourse ware. I'm a beginner and
> have some what knowledge of c and c++. I'm using Python version
> Here is my code:
[code cut]
Before showing code, try to express what you're trying to do in
Hi Richard,
The "return" statement does an early escape out of the currently
running function.
You have a "return" statement in your program that looks
unintentional. In an ideal world, the Python compiler would give a
warning about this because it's a common mistake. Unfortunately it
looks lik
On Tue, Sep 27, 2016 at 2:23 AM, source liu wrote:
> Hi, List
>
> the test code as attached
Unfortunately, it didn't attach. If you can inline the content of the
test code, that would be helpful.
> this one works print p.map(partial(file_op,lineop=unity),input)
> this one doesn't
> On 05/10/16 10:03, rakesh sharma wrote:
>> Hi all
>>
>> I have a string of pattern ({A,BC},{(A,B),(B,C)(C,A)}.
>
On Wed, Oct 5, 2016 at 3:14 AM, Alan Gauld via Tutor wrote:
> Until we understand the data better we can't be sure
> a regex is the best solution.
Yes, I agree with Alan: we need t
On Sat, Oct 8, 2016 at 3:29 PM, Jim Byrnes wrote:
> I realize that my question is not about the standard library. The only
> reason I am asking here is, if I remember correctly, a regular contributor,
> Danny Yoo, works at Yahoo. I am hoping he, or someone else here can help me
> und
Please do not give homework solutions. Thanks.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
> Thinking of a situation where I have two "processes" running. They
> each want to operate on a list of files in the dir on a first come
> first operate basis. Once a process finishes with the file, it deletes
> it.
>
> Only one process operates on a file.
>
> I'm curious for ideas/thoughts.
Hi
On Thu, Oct 27, 2016 at 5:40 PM, Jim Byrnes wrote:
> Is comp.lang.python available on gmane?
>
> I've googled and found references to it being on gmane but I can't find it
> there. I'd like to use gmane because Comcast doesn't do usenet anymore.
Hi Jim,
I think Gmane is still recovering:
h
> program-they just do it. Also noticed-when starting new file sometimes I
> see run at the top sometimes not? Lots of questions. Familiar with
> programming in C.
If you're a database and C developer, then you probably have enough
experience to go through the Python tutorial, as it is aimed for
>>>
>>> Is comp.lang.python available on gmane?
>>>
>>> I've googled and found references to it being on gmane but I can't find
>>> it there. I'd like to use gmane because Comcast doesn't do usenet
>>> anymore.
>>
>>
>> I don't know about the current viability of gmane in general, but it's
>> calle
Ah. The wiki link does point to the expected place after all.
I think, then, that the initial assessment is accurate, that Gmane is still
recovering their archives, and that eventually the link will work again.
___
Tutor maillist - Tutor@python.org
To
On Nov 1, 2016 4:57 PM, "Haley Sandherr" wrote:
>
> Hello, I am new to python and need help with this question:
>
> Compose a function odd ( ) that takes three bool arguments and returns
True if an odd number of arguments are True and False otherwise.
Do you understand all of the terms in the que
Hi Clayton,
I'm not too familiar with development on Windows, unfortunately, but I
think the 'subprocess' module is what you're looking for.
https://docs.python.org/3/library/subprocess.html
For example:
http://stackoverflow.com/questions/748028/how-to-get-output-of-exe-in-python-script
sh
Hi Edmund,
For each of the cases that surprise you, next time, can you also say
what you expected to see? That can help us see where the confusion
lies; as it stands, if we have the same mental model as what's
happening in Python, then the results look correct to us. :P
I can guess at what you
> I'm still somewhat confused as to what the regexp module is doing when
> passing a non-numeric count parameter. That looks like it should
> raise a TypeError to me, so perhaps someone needs to file a bug
> against the standard library? Unsure.
Ok, I'm filing a bug to the Python developers so
Following up: drats! Detecting this conceptual TypeError is not
feasible under the current design, due to the choice of data
representation used in this API.
The reason is because the flags are being represented as integers, and
we're using bitwise operations to define the union of flags. That i
On Thu, Dec 8, 2016 at 1:11 AM, Alan Gauld via Tutor wrote:
> On 08/12/16 06:04, Palanikumar wrote:
>> #Function Argument unpacking
>> def myfunc(x, y, z):
>> print(x. v. z)
>>
>
> Please always send the actual code that generates
> the error, do not retype as it causes us to chase
> phantom
On Sat, Dec 24, 2016 at 2:40 PM, Jim Byrnes wrote:
> subprocess.call(['libreoffice', '/home/jfb/test.ods'])
> k.tap_key(k.enter_key)
> k.tap_key(k.enter_key)
>
> If I run the above code, libreoffice opens the test.ods spreadsheet then
> just sits there. When I close libreoffice the two enter_keys
On Jan 19, 2017 4:36 PM, "ad^2" wrote:
Hello all,
I'm looking for a cleaner more elegant way to achieve stripping out a file
name from a list which contains a path and file extension.
Would os.path.split help here?
https://docs.python.org/3.6/library/os.path.html#os.path.split
___
Files don't rewind automatically, so once a loop goes through the file
once, subsequent attempts will finish immediately.
We might fix this by "seek", which will let us rewind files.
However, your data is large enough that you might want to consider
efficiency too. The nested loop approach is go
Believe it or not, a change in two characters should make this even faster. :)
Change the line:
file_list = [i[:-1] for i in my_list.readlines()]
to:
file_list = {i[:-1] for i in my_list.readlines()}
The change is to use a "set comprehension" instead of a "list
comprehension". Sets
> That's because dictionaries are not stored sequentially and the
> order of retrieval is not guaranteed - it can even change
> during the execution of a program so you should never
> depend on it. That's because dictionaries are optimised
> for random access via the keys not to be iterated over.
Hi Joe,
On Mon, Feb 20, 2017 at 6:32 AM, Joe via Tutor wrote:
> Hi,
> I keep getting the following error as I am new to programming and I am
> following a tutorial and I am using Python 3.6. Can you please point me in
> the right direction as to what I am doing wrong.
You have made an assump
Hi Ryan,
Let's take a look...
Overloading the "write" method to take in different types of arguments
looks a bit suspicious.
You have a superclass that defines a write method, and you have two
subclasses that implement that method. However, your first
implementation, LogFile.write, appears to
Hi Palanikumar,
It looks like you're using Python 2, since you're referring to
SimpleHTTPServer. But you probably do not want to use
SimpleHTTPRequestHandler: it's a local file system server. The docs
at
https://docs.python.org/2/library/simplehttpserver.html#SimpleHTTPServer.SimpleHTTPRequestH
On Fri, Jan 25, 2013 at 4:57 PM, anthonym wrote:
> I have the code below that I used to create a simple tic tac toe game for
> class. I am learning Python but have programmed in C+ before so I brought
> over a lambda and found that it worked in Python. Unfortunately I don't
> think my classmate
> Hi guys I wanted to make a program called Binary/decimal converter. But I
> want to do it the hard way e.g. not using built in python functions. Can you
> give me an idea about how I can do that?
Do you have an idea of what kind of things would be useful test cases
for this converter? Thinki
> Or maybe, just maybe, somebody has written a javascript interpreter in
> Python as a module that you can import. It sounds just about crazy enough
> that it might even exist! But as I said, that's probably the wrong thing to
> do...
A direct approach would probably use the webdriver API to autom
> After downloading pip, I tried to install it:
> cd /Applications/pip-1.2.1
> install pip
>
> I got this strange message:
> usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
>[-o owner] file1 file2
>install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-
On Thu, Jan 31, 2013 at 11:36 AM, heathen wrote:
> why is this:
>
d *= 3 + 4
The gory details about how Python understands this expression can be found in:
http://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements
Technically, "3 + 4" is the "expression lis
> How to do PCA on this data? if it is in array how to do that? and also how
> to use princomp() in PCA?
Principal component analysis,
http://en.wikipedia.org/wiki/Principal_component_analysis
may not be "built in". Do you know for sure that it is? According to
this blog entry, you can do
On Sat, Feb 9, 2013 at 6:25 PM, mann kann wrote:
> I used webbrowser and it worked via terminal, but the same code returns
> AttrituteError: 'module' object has no attribute 'open' in komodo edit.
> suggestions? here's the code:
>
> import webbrowser
> webbrowser.open("http://youtube.com";)
What
On Mon, Feb 11, 2013 at 9:06 AM, Pravya Reddy wrote:
> Can you please help me with the code.
>
> #!/usr/bin/env python
> """
> inchtocm.py
>
> """
>
> def Inchtocm(inches):
> """Returns 2.54 * inches"""
> return (2.54 * float(inches_number1))
I don't know if your curriculum talks about w
>> Hi, I signed up a while ago, but I didn't really understand anything. I
>> have a basic question that maybe someone can help with. I'll like to
>> integrate yelp data -- http://www.programmableweb.com/api/yelp -- onto
>> google maps -- http://www.programmableweb.com/api/google-maps -- like
>> ho
On Sat, Feb 16, 2013 at 5:11 PM, Claira wrote:
> I dont know how this mailing list thing works, first time on it, they
> should have something that makes sense like quora.com
>
>
Be aware that mailing lists have a pretty long history, at least in
computing terms. You might be interested in readi
> Does this comment extend to C++? :-)
>
> Could the experts, please, recommend a beginner's book to learn the
> principles of good programming?
I'm partial to How to Design Programs as a beginner's textbook:
http://www.ccs.neu.edu/home/matthias/HtDP2e/
because it emphasizes a systematic ap
> Consider the (20x20) array of numbers here(I wrote all of the numbers in
> my program). Lets say this represents a matrix A of distances (in
> kilometers) between cities. Note that A is symmetric A(i,j) = A(j,i) and all
> its diagonal elements are zero. Suppose Vladimir from city i and Petra from
> Why is this happening, and how do I get it to work properly (returning
> element 0 - n, versus n - 0)?
Python dictionaries are unordered collections. When we iterate across
them, we can not guarantee that we'll walk the elements in the order
that we inserted them. The reason for that is becaus
> (a) Write a function which converts from gallons to cups2
Do you know how to write functions? Can you write a function that
takes a number and returns twice that number, for example?
Show us what you have seen already, and we may be able to start from there.
The question you are asking does
On Thu, Mar 7, 2013 at 1:55 PM, akuma ukpo wrote:
> i don't know how to write functions. so i guess that is where i'm stuck. i
> was following a tutorial on my lab document but i still did not understand
> what to do. i will attach the pdf and python files as well.
I am CCing the rest of the Pyth
On Thu, Mar 7, 2013 at 2:36 PM, akuma ukpo wrote:
> I am defining the function in one .py file and testing the function in
> another .py file.
>
> this is my code for the test:
>
> def test_quantity_convert(self):
> self.assertEqual(gallons_to_cups(0), 16)
Good, thanks for showing us
>
> It's a filter:
>
> https://docs.djangoproject.com/en/1.5/ref/templates/builtins/
And to be explicit about Mitya's point: it's technically not Python.
It's part of Django's template language. If it were Python, it'd be
interpreted as the "or" bitwise operator,
http://docs.python.org/3/re
On Mon, Mar 11, 2013 at 8:59 PM, akuma ukpo wrote:
> This is the problem
>
> Implement a function called get_direction which, on a particular character
> , gives the
> direction corresponding to that character.
Do you know how to write a test case for this function?
You had test cases for one o
The use of index() here to find the target place where the translation
is going to occur is very fragile.
Consider: we conceptually already should know where in the list we
want the target to be, since we're walking across the characters in
the list. We know that we're looking first at ls[0], tra
On Tue, Mar 12, 2013 at 9:00 AM, RJ Ewing wrote:
> Thank you all for the help. I really appreciated the suggestions. Some of
> the things you pointed out, I originally used, but started changing thing
> when it wasn't working. I got it to work, but if you could let me know if
> there is anything I
> ##
> ## rot1: char -> char
> ## Rotates a single character.
> def rot1(char):
> if char.isupper() or char.islower():
> test = 'M' if char.isupper() else 'm'
> if char <= test:
> return chr(ord(char) + 13)
> else:
> return chr(ord
> Also note that I've deliberately left alone a bug in rot1(), to make
> it easier to show a flaw in the original code that you'll want to fix.
Doh. Never mind. _I'm_ the one who introduced that regression. :( Sorry!
Here's a corrected definition for rot1():
#
de
> I just started with Python and found a course named "Python programming" by
> Jody S. Gunther.
> My problem starts with the chapter "Introduction to Modules".
> The first line in the program is:
> from tkinter import *
> and here I'm getting an error:
> ImportError: No module named tkin
Side note: I would strongly suggest using the biopython libraries for
the basic parsing. FASTA parsing has been done and replicated so many
times that it's almost a hazing ritual for the practicing
bioinformatician. The biopython folks have written a parser, so
perhaps you can reuse it.
http
>> if condition is 1:
>> do something with 1
>> elif condition is 2:
>> do something with 2
>> else: # Impossible unless the code above is flawed.
>> Raise Exception
>
>
>
> The above isn't a great example, because the sample code *is* flawed.
> The short reason why it is flawed is t
Hi Ali,
Again, I recommend not reinventing a FASTA parser unless you really
need something custom here. In this particular case, the function
ReadFasta here is slow on large inputs. The culprit is the set of
lines:
if line[0]=='>':
prevLine=line[1:]
d
For example, see: http://nltk.org.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
What's the part that's "changing"? What's the part that stays the same?
I would recommend thinking of this in terms of a function.
Can you write a function that consumes a letter l and returns the
string "This is ..." where "..." is the uppercased l?
As an example of a simple function on string
Wait. If the solution that we're stopping at to use a hashtable here,
that's not quite right. A good solution to this should be _much_
shorter, on the order of a one-liner. Hashtables are great, but
they're not the answer to everything.
If we're doing something like:
a -> "This is A"
b
Yup! Sorry about my tone for its stridency. But I just got concerned
that the original poster seemed content about turning the chain of if
statements into a table definition. To my mind, they're very closely
related, data and control. I'm trying to push the OP to realizing
that if they are doin
.argv read parameters
To: Danny Yoo
Hello Danny,
The part that is changing is just the sys.argv[1]
The vars will have always the same content.
What I don't want is to have like 255 'ifs' if I have 255 vars.
On Wed, Apr 17, 2013 at 5:03 PM, Danny Yoo wrote:
>
> What
Ok, good. This is _much_ more realistic code, and demonstrates why
seeing context is important.
My suggestion to do it computationally is totally invalid here. :P
There's a lot of variation here, due to the access paths through the
JSON that you're walking. You're essentially defining a very
l
Followup: compare the previous interpreter code with this revision:
https://gist.github.com/dyoo/5415464
and you'll see how it becomes easier now to add new command types into
the system.
___
Tutor maillist - Tutor@python.org
To unsubscribe or cha
According to the documentation in:
http://www.virtualenv.org/en/latest/
and:
https://pypi.python.org/pypi/virtualenv
the "Installation" section in the documentation walks through what you
need to do to install the software.
Can you use Python's package managment system "pip" to handle
Hi Roelof,
On Tue, Apr 23, 2013 at 1:39 PM, Roelof Wobben wrote:
> Im trying to learn python by a course at codeacademy.
>
> Now I have this code :
>
> def shut_down(s):
> s = s.lower()
> if s == "yes":
> return "Shutting down..."
> elif s == "no" :
> return "Shutdown
On Wed, Apr 24, 2013 at 10:11 PM, boB Stepp wrote:
> In my on again, off again studies of Python I am stumped on something
> that ought to be trivial, but I am not seeing it. When I run this
> program (only the part up to where the error occurs is shown):
>
> import random
>
> numberToGuess = ran
> elif days >= 3 < 7:
This condition here, as well as:
> if days >= 3 < 7:
this condition here, looks very suspicious. Can you say what you
trying to express here?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription
On Fri, May 10, 2013 at 3:19 PM, Jim Mooney wrote:
> If I'm using a variable-dependent range in a for loop, is Python smart
> enough to figure the variable once so I don't have to hoist it up?
Hi Jim,
The gritty details say "yes":
http://docs.python.org/2/reference/compound_stmts.html#the-
>
>
> print(list(uneven_squares(10,1))[2:10]) #slows as y gets bigger, then
> dies
>
>
You'll want to stick with sequence operations that do not force the entire
generator's output. In this specific case, try itertools.islice.
http://docs.python.org/2/library/itertools.html#itertools.islice
__
> So how does one access a generator one element at a time? I thought
> next would do that so I tried:
>
> print(next(uneven_squares(10,1000)))
> print(next(uneven_squares(10,1000)))
> print(next(uneven_squares(10,1000)))
Each call to uneven_squares(10, 1000) creates a fresh iterator. You
may wa
The standard sorting in Python depends on a comparison operator. A
quick and easy comparison operator that Python uses for strings is
lexicographic ordering:
http://en.wikipedia.org/wiki/Lexicographical_order
The quick and dirty rule is: dictionary order, with each character
consistently tre
Do you have other domain-specific information about this text? Concretely:
if you have another similar report, what parts will have to stay the same,
and what parts might change?
You want to make sure whatever you're using to anchor and search is based
on something stable. Otherwise, your progra
>
>
> The part that always change is the , it can be 1 digit or 4 digits.
> Example: 1.
> The part that never changes is the 1700.
>
>
You most likely need to be more specific with your pattern matching.
Why should we expect no other numbers to be "1700"? I see several fields
in the form tha
Yes. Concretely, I'm trying to see if it's appropriate to look at this:
###
-LAL USER FILE-
NAME UORD T/O O OXIT RXIT SMAX INUSE PCT
--- - - - - ---
J4IB
Hi Zaid,
Your YellowCar will have one once its reset() has been called. However, I
don't see it in __init__(), so there might be a period of time where it
won't have one. I haven't traced through possible code paths where this
happens, but I suspect one of them may. One example may be:
c =
On Sat, Oct 19, 2013 at 7:29 AM, Manish Tripathi
wrote:
>
> I am trying to import a csv file in Pandas but it throws an error. The
format of the data when opened in notepad++ is as follows with first row
being column names:
>
> "End Customer Organization ID,End Customer Organization Name,End Custo
>
> * Where is this data coming from?
> * Who or what is generating this file?
Just to be more specific about this: I have a very strong suspicion that
whatever is generating the input that you're trying to read is doing
something ad-hoc with regards to CSV file format. Knowing what generated
th
On Mon, Oct 21, 2013 at 11:57 AM, Manish Tripathi wrote:
> It's pipeline data so must have been generated through Siebel and sent as
> excel csv.
>
>
I am assuming that you are talking about "Siebel Analytics", some kind of
analysis software from Oracle:
http://en.wikipedia.org/wiki/Siebel_Sy
>
>
> I agree. I've recently started coaching the son of a friend in computing
> for his new school (he is effectively a year behind
> his new classmates). They use VB6 but at a level I can cope with! :-)
>
> The interesting thing however is that the schools have not taught
> any kind of approach t
On Wed, Oct 23, 2013 at 4:13 PM, Alan Gauld wrote:
> On 23/10/13 22:39, Shelby Martin wrote:
>
>> I've looked online but I'm confused - I need to keep it so that the
>> following program limits the output to two decimal places since it deals
>> in currency.
>>
>
> Its generally a bad idea to use f
> And does python being an interpreted language have to do anything with
this?
I have to interrupt: you mean to say: "And does the C implementation of
Python (CPython) have to do anything with this?". There are several
implementations of Python out there. Not all of them use an interpreter in
th
On Thu, Oct 24, 2013 at 9:37 AM, Shelby Martin wrote:
> Thank you for your replies. I suspect the solution is a bit more advanced
> than where I'm at now, which is chapter 2 of a beginner's book.
>
Probably because talking about the gory details would completely derail the
conversation, as I did.
Hi Sm,
Note: if possible, I would strongly suggest reusing csv.reader rather than
reinvent this. It comes in Python's Standard Library:
http://docs.python.org/3/library/csv.html#module-csv
---
Anyway, to your question. Do you know what is the encoding of your input
file?
(And if you don
>
>
> Note: in* 'call' : Update* ,Update it is a function defined in my python
> script. My dictionary is too large so i taught rather than using directly
> in python program I save it in a text file and when needed i assign it to
> dictionary object . How can i assign this text file to dictionary
As an aside: It shouldn't be too bad to write a "generator" for the
geometric series, so that we can pick out the terms on-demand.
#
>>> def geometric(base):
... x = 1
... while True:
... yield x
... x *= base
...
>>> twos = geometric(2)
On Mon, Nov 4, 2013 at 9:41 AM, Amal Thomas wrote:
> @Steven: Thank you...My input data is basically AUGC and newlines... I
> would like to know about bytearray technique. Please suggest me some links
> or reference.. I will go through the profiler and check whether the code
> maintains linearity
>
>
> > Also as I have mentioned I cant afford to run my code using 4-5 times
> memory.
> > Total resource available in my server is about 180 GB memory (approx 64
> GB RAM + 128GB swap).
>
> OK, There is a huge difference between having 100G of RAM and having
> 64G+128G swap.
> swap is basically d
>
> You _must_ avoid swap at all costs here. You may not understand the
> point, so a little more explanation: touching swap is several orders of
> magnitude more expensive than anything else you are doing in your program.
>
> CPU operations are on the order of nanoseconds. (10^-9)
>
> Dis
>
>
> from a SQLite database I get a value by SELECT s from... which normaly is
> a string, but can be the NULL value, wich means it is not defined. To put
> the value into a form (made by QT) I need a string representation.
>
> str(s) gives either the string itself (which is good) or "None" (which
>
>
> If i input a number, i should get a perfect cube nearest to it.
> For eg: if
> input=4, output=8
> input=8, output=27
> and so on
>
Let's consider those examples. Pretend you were given:
input = 4
and the description of the problem. Forget computers for a brief moment.
What woul
On Fri, Nov 8, 2013 at 4:54 AM, donsuni wrote:
> Hi, I have a problem in python which is kind of tricky.
>
> if i give a sequence of numbers, i should get another sequence of numbers
> such that the the elements exceeds previous element in the list. For eg
>
Have you written any other functions
For reference, here are the documentation pages for ord() and chr():
http://docs.python.org/3/library/functions.html?highlight=chr#ord
http://docs.python.org/3/library/functions.html?highlight=chr#chr
On Mon, Nov 18, 2013 at 3:01 AM, Alan Gauld wrote:
> On 18/11/13 03:27, Byron Ruffin
I agree with Peter Otten. I want to try restating what he said to try to
emphasize what I think is the key point.
One basic skill that you learn as a programmer is how to handle nesting.
One strategy is to give things names. This can have benefits:
1. The name itself might make the code ea
> Ok, got you!
>
> print("TIME TRACKING")
>
> while True:
> hours_worked = input("How many hours did you work today? ")
> try:
> hours_worked = float(hours_worked)
> break
> except ValueError:
> print ("Invalid input")
> if hours_worked < 24:
> print("You mus
1501 - 1600 of 2125 matches
Mail list logo