•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 428,474 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,191 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 340 | Replies: 4
•
•
Join Date: Apr 2008
Posts: 32
Reputation:
Rep Power: 1
Solved Threads: 0
How can i create a function which sort a list in this way for example if list 4,4,2
4,4,2
3,3,1,3
2,2,0,2,4
1,1,0,1,3,4
0,0,0,0,2,3,4
0,0,0,0,0,1,2,3,4
If the list is impossible to sort then the program have to try it 15 times not more.
The function which I wrote does it only one time not more??
can anyone help me?
Thanks a lot for all help and advice.
4,4,2
3,3,1,3
2,2,0,2,4
1,1,0,1,3,4
0,0,0,0,2,3,4
0,0,0,0,0,1,2,3,4
If the list is impossible to sort then the program have to try it 15 times not more.
The function which I wrote does it only one time not more??
x=[4,4,2]
def kopi(x):
b=0
y = []
for j in x:
b+=1
y.append(j-1)
y.append (b)
print y,b
return yThanks a lot for all help and advice.
•
•
•
•
•
•
•
•
DaniWeb Python Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- explorer.exe uses 99% CPU (Viruses, Spyware and other Nasties)
- adding & subtracting objects from a list (C++)
- Open In New Window Php (PHP)
- cam ActiveX control? (C++)
- Quicksorting linked list - simple algorithm (C)
- Please someone give me some good advice asap please (Advertising Sales Strategies)
- please help me with the last bit?? (C)
- Heeeeeeeeeeeeeeeeelp pleeeaaazzzz :cry: :cry: :cry: (C)
Other Threads in the Python Forum
- Previous Thread: Trouble with a certain Exception
- Next Thread: Python interaction with firefox?



Threaded Mode