Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Multiple "return" statements or "result" variable?
Post: RE: Multiple "return" statements or "result" varia...
Okay, maybe I shouldn't have put the example since it seems its confusing. I just wanted to illustrate what I was saying, never said this bit of code was correct, I actually stated I knew it was not g... |
|
WolfWayfarer |
General Coding Help |
7 |
7,747 |
Jul-25-2018, 12:05 AM |
|
|
Thread: Multiple "return" statements or "result" variable?
Post: RE: Multiple "return" statements or "result" varia...
Allright, I'm not the only one wondering why. After reading that and this part I still have somehow mixed feelings about it.
To think that a field as allegedly "modern" as programming would desperatel... |
|
WolfWayfarer |
General Coding Help |
7 |
7,747 |
Jul-24-2018, 05:16 AM |
|
|
Thread: Multiple "return" statements or "result" variable?
Post: Multiple "return" statements or "result" variable?
I've been wondering about the best option between multiple return statements and the use of an intermediary result variable. This of course in the case of conditional blocks within a function.
I reme... |
|
WolfWayfarer |
General Coding Help |
7 |
7,747 |
Jul-24-2018, 02:14 AM |
|
|
Thread: List with "or" value?
Post: RE: List with "or" value?
(Jul-23-2018, 08:13 AM)perfringo Wrote: If it's all about not using proper tools then I would suggest to blow your teachers mind with following Monty-liner*:
year = 2014
months = sum([[[31, 30][i &... |
|
WolfWayfarer |
Homework |
6 |
3,883 |
Jul-23-2018, 09:05 AM |
|
|
Thread: Listing the factors of a number
Post: RE: Listing the factors of a number
Being a beginner myself I'll give you the little help I can think of, you might want to document your functions, instead of using a comment line on top with:
#my commentyou could try the docstring whi... |
|
WolfWayfarer |
Code sharing |
2 |
2,478 |
Jul-23-2018, 08:03 AM |
|
|
Thread: List with "or" value?
Post: RE: List with "or" value?
Thanks Dead_Eye, I hadn't thought of that.
@perfringo: we're not allowed to use the calendar module, we have to do it "manually" so yeah, we're asked to invent the wheel although cars exist. I'm not ... |
|
WolfWayfarer |
Homework |
6 |
3,883 |
Jul-21-2018, 01:16 AM |
|
|
Thread: List with "or" value?
Post: List with "or" value?
I'm having trouble with an assignment about leap years. I had a basic (ugly) code that did the job, however when I asked for feedback from the teacher he sent me a corrected version of my code, asking... |
|
WolfWayfarer |
Homework |
6 |
3,883 |
Jul-20-2018, 04:13 AM |
|
|
Thread: Hangman game, feedback appreciated
Post: RE: Hangman game, feedback appreciated
@Windspar: so there is a main() in Python too! I'm glad, it felt really weird after C just barging in like that. I'm surprised OC doesn't say it, or perhaps I missed that part. Anyhow, thanks alot. It... |
|
WolfWayfarer |
Code sharing |
10 |
7,879 |
Jul-19-2018, 08:44 AM |
|
|
Thread: Hangman game, feedback appreciated
Post: RE: Hangman game, feedback appreciated
(Jul-16-2018, 01:57 PM)ichabod801 Wrote: And these three are equivalent in the context of your code:
re.match("[a-z]", param) is not None
re.match('[a-z]', param)
param.isdigit()
Thanks for the equ... |
|
WolfWayfarer |
Code sharing |
10 |
7,879 |
Jul-17-2018, 02:40 AM |
|
|
Thread: Hangman game, feedback appreciated
Post: RE: Hangman game, feedback appreciated
Thanks a lot for all the input.
I've just become aware of the PEP-8 standards and will comply with the lower case and underscore now.
As for the over complicating things, the bits of code you showed ... |
|
WolfWayfarer |
Code sharing |
10 |
7,879 |
Jul-17-2018, 02:06 AM |
|
|
Thread: New Users Introduce Yourself
Post: RE: New Users Introduce Yourself
I'm currently operating a change in my carrer, going back to studying and hoping to become a programmmer.
University requires us to take Python as first language and honestly I find it much easier to ... |
|
WolfWayfarer |
Bar |
431 |
228,849 |
Jul-16-2018, 08:51 AM |
|
|
Thread: Feedback on my first program?
Post: RE: Feedback on my first program?
Hey,
I'm new to Python and programming so won't be of much help but for chosing the option, since you want to match keywords to the name of an option, why not try and use RE (Regular Expressions)? I'v... |
|
WolfWayfarer |
Code sharing |
6 |
4,656 |
Jul-16-2018, 08:42 AM |
|
|
Thread: Hangman game, feedback appreciated
Post: Hangman game, feedback appreciated
I've been taking the OpenClassroom Python course and the recent assignment was a Hangman with several specific requests:
- there should be separate files such as main, functions, etc.
- it should hand... |
|
WolfWayfarer |
Code sharing |
10 |
7,879 |
Jul-16-2018, 08:19 AM |