3,386 Posted Topics

Member Avatar for neo_31591

How would we know, it is your code, we know nothing. MenuPage is not defined, like it says.

Member Avatar for TrustyTony
-1
310
Member Avatar for Yoink

> while len(runway1) > 0 and len(runway2) > 0 and len(runway3) > 0 This should be `or` not `and` > run1Plane = top(runway1) > topPassenger1 = run1Plane.getNumOfPassengers() This would need to go inside a if runway1: Then you would keep looking which of stacks has the value to pop, but …

Member Avatar for scudzilla
0
266
Member Avatar for invisiblemaa

Are you checking for straights 1 2 3 4 5 and 10 J Q K A How your code separates hands with same highest card but different second highest? Please use **Code** from editor, do not link to code out of the site. I have lost my Python code for …

Member Avatar for TrustyTony
-1
587
Member Avatar for how_too

There are many Python tutorials around, just Google. Also the vegaseats sticky message threads and the code snippets archive can be helpful.

Member Avatar for Lardmeister
0
239
Member Avatar for Kirielson

m and n are undefined, the loop until len(n) as n[len(n)] does not exist. Also limit of len(n) on second loop does not make sense, as n is not used in loop. Also len(a) is not len(n), but len(m)+1.

Member Avatar for Kirielson
0
331
Member Avatar for adeel381

1. Find out base case 2. Find out how you can solve case n with cases upto-not-including n 3. Write the code 4. Debug 5. Deploy 6. Train users 6. Maintain

Member Avatar for TrustyTony
0
144
Member Avatar for straylight

What is your problem and what you are trying to do? I do not undetstand reference to read(50) as it has nothing to do with your code which reads lines. Line 3 does nothing. Your example input is only one line, so not very good test input for the loop.

Member Avatar for TrustyTony
0
288
Member Avatar for jtaylor-bye

You just indent code inside another while loop. However using functions and good descriptive names according to PEP8 guidelines is good to have in your toolbox before tackling big projects. It is good to form correct habits from begining.

Member Avatar for jtaylor-bye
0
103
Member Avatar for jbennet

First points noticed: This post has not line numbers correct: http://www.daniweb.com/software-development/python/threads/418422/python-3.2.2-question/1#post17841 in it's code. The single 5 in margin looks stupid in margin for short code examples just over five lines, this is surely going to cause slew of newbies typing the line number in the code. The Featured Poster …

Member Avatar for Airshow
0
2K
Member Avatar for TrustyTony

As I looked through the rules I did not find direct reference of not bumping messages, like this http://www.daniweb.com/software-development/python/threads/420770/pygame-quick-help#post1796253 I can of course down vote, as it does not require breaking the rules, but would be nice to get few comments about the unwritten law ##Thou shalt not bump your …

Member Avatar for happygeek
0
227
Member Avatar for learned1

You got zillion of input functions without prompts in your first code, it couldn't possibly be debugged enough to add more features. You must allways be sure that the old code is as bug free as possibly can, before adding things or you end up in mess (and looks like …

Member Avatar for hughesadam_87
0
178
Member Avatar for vmars
Member Avatar for Twin802

you have many undefined and unused/unnecessary variables. Especially clumsy are first lines. Also the variable names are cryptic.

Member Avatar for Twin802
0
228
Member Avatar for fishsticks1907

@wooeee: you are doing selection sort not bubble sort. On the other hand bubble sort is so inefficient, that you should use insertion or selection sort. ______ For bubble sort it is customary to set flag for if swaps were made and stop sort when no swaps were done in …

Member Avatar for TrustyTony
0
250
Member Avatar for SpiritualMadMan

That is not Python, it is C++. Before transferring to C++ forume, why do you have pyQT in title?

Member Avatar for Lardmeister
0
413
Member Avatar for Kyle Willett

For me looks like your stack exposes the implementation detail of stacks array index, which does not make any kind of sense. I would suggest to check first of all to check your logic, can you show proof that your c++ version works?

Member Avatar for Kyle Willett
0
619
Member Avatar for cplusfreak

Also looks like your code fails to calculate 0/3 Additionally you are defining div wrong with float and calling with int. @nullptr: it should be **==** in continuation condition, not or, as at least I can not find way to make `cont` to equal both 'y' and 'Y' at the …

Member Avatar for thines01
0
159
Member Avatar for Ancient Dragon

Sounds heavenly, just hit TAB and then paste code and everything goes OK without being a painter (as long as syntax check identifies those unclosed vb quoted line end remarks and does OK format for them.)

Member Avatar for Dani
0
259
Member Avatar for pendo826

@ Lerner: And you must have thought out some examples planned before at hand to test the addition, so it basically means: **Better do Test Driven Development**

Member Avatar for TrustyTony
0
400
Member Avatar for svcj92
Member Avatar for WaltP

For psycology/marketing motivated choices I suggest to accept Dani's solutions. For me what matters most is only that if you hit *Code* and after paste my code it works in 1. VB forum with 'Comment here (does not matter for me personally, but seems really biggest problem of the system …

Member Avatar for Airshow
1
246
Member Avatar for samytaqq

Are you sure you are not going against [MEMBER RULES](http://www.daniweb.com/community/rules) ?

Member Avatar for m4ster_r0shi
0
140
Member Avatar for Twin802

Looks like you you are having unterminating while if you do not change the value of a in other loops. For me the a variable looks without purpose, why not just break out of while, no need for sentinel variable, it only confuses the issue.

Member Avatar for Twin802
0
105
Member Avatar for jdm3

I do not catch exactly what you want to do as line 7 does nothing and so the loop is without purpose. import urllib2 as u zipc = "47408" url = "http://watchdog.net/us/?zip=" conn = u.urlopen(url+zipc) for line in conn: if 'Represented by' in line: print(line)

Member Avatar for jdm3
0
218
Member Avatar for Begginnerdev

The information on new tagging scheme have not reached even members who have posts under belt allready. http://www.daniweb.com/software-development/cpp/threads/420810/y-linked-list#post1795231

Member Avatar for Dani
0
295
Member Avatar for zaken5000
Member Avatar for willjohanz

Find which of these [membership rules](http://www.daniweb.com/community/rules) you are breaking, and fix it!

Member Avatar for Ancient Dragon
-1
92
Member Avatar for Ancient Dragon
Member Avatar for moroccanplaya
Member Avatar for sinnebril
Member Avatar for xav.vijay
Member Avatar for Bun2014

Use the edit post link do not post again. And please indent all your code one level by highlight and pushing TAB key to make it formatted as **Code** or put ~~~ vb ~~~ around the code (line before and line after), ~ must be the first character on line. …

Member Avatar for TrustyTony
0
201
Member Avatar for treyb
Member Avatar for nee_88

You have also problem in your formatting and/or indenting. Did you read the [Formatting Help](http://www.daniweb.com/community/syntax) ?

Member Avatar for rubberman
0
105
Member Avatar for frivolous

You could [compile from source code](http://www.wxpython.org/BUILD-2.8.html) with same C compiler as was used for your Python version. Why not just upgrade to Python 2.7.2? Or you are using embedded Python inside an application?

Member Avatar for ZZucker
0
695
Member Avatar for willjohanz

No, we can not, see [Member rules](http://www.daniweb.com/community/rules) **Do provide evidence of having done some work yourself if posting questions from school or work assignments**

Member Avatar for TrustyTony
0
63
Member Avatar for bishisht
Member Avatar for TrustyTony

New Daniweb way to copy the code from posts with indentation is to double click (not too quickly) to select the code region and use normal copy paste as you like (second mouse button or ctrl-c). Easier than before but little not obvious!

Member Avatar for TrustyTony
1
299
Member Avatar for Sahil89

Notice though that mark of selection is not colored background, but only lines around message turns yellow. Lines are very thin and the change is almost invisible.

Member Avatar for Sahil89
0
169
Member Avatar for flynwltn
Member Avatar for BThomps

Why you are using random module but reimplement the random.sample? ~~~ >>> import random >>> import string >>> print random.sample(string.digits, 5) ['6', '2', '5', '1', '8'] ~~~ Also the commenting is very superfluous.

Member Avatar for BThomps
0
239
Member Avatar for salina786

Use code blocks (select code and hit TAB key), see Formatting Help in corner of reply box.

Member Avatar for salina786
0
296
Member Avatar for TrustyTony

The vanity pages to look how good and active you are compared to others is back from member's #Community Contributions part underlined links. Thank you Dani, now we know again how good we are! *P.S. How many activity points worth is giving a spammer infraction? ;)*

0
184
Member Avatar for aquaben

You never call the functions and you have many other problems like undefined variables and incorrect conditions.

Member Avatar for TrustyTony
0
150
Member Avatar for lisa92222
Member Avatar for TrustyTony
0
107
Member Avatar for Reverend Jim

use the ~~~ vb style fencing code blocks for vb with quote comments, see Formatting Help. I fixed the original post for you.

Member Avatar for Reverend Jim
0
2K
Member Avatar for pennywise134

Reading is helpful skill, start from here for example http://www.linfo.org/wildcard.html

Member Avatar for chris.stout
0
125
Member Avatar for sicko

Please for vb code use ~~~ vb .... ~~~ fenced code tags if you use quote comments, otherwise you can select the code block and hit TAB.

Member Avatar for Mitja Bonca
0
125
Member Avatar for abhik1368

And here with itertools 'magic', as here seems to be time for present solutions: from itertools import groupby # space separated data raw_data = '''DB01967 ZIPA DB01967 PFAZ DB01992 YVBK DB01992 ZAP70 DB02191 ZIPA DB02319 YQHD DB02552 ZFPP'''.splitlines() data_groups = groupby(raw_data, key = lambda x: x.split()[0]) for group, items in …

Member Avatar for TrustyTony
0
133
Member Avatar for webstart

a[0], the first value, but you get trouble with first empty list. It is more flexible to use list comprehension instead of map.

Member Avatar for vegaseat
0
6K

The End.