Home>
I want to display the contents of Quicksort
Error messageI want to sort and print the contents of a quick sort made in Python, but it doesn't work. I want to help.
Error message
Python3.7
Source code
A = list [9, 2, 7, 5, 4,100,50,32,33]
def quick_sort (A):
n = len (A)
if n<= 1:
return A
pivot = A [0]
right = []
left = []
for i in range (1, n):
if A [i]<= pivot:
left.append (A [i])
else:
right.append (A [i])
R = quick_sort (right)
L = quick_sort (left)
return L + pivot + R
print (quick_sort (A))
Nothing was displayed.
-
Answer # 1
Related articles
- [python3] i want to display the numerical list from excel vertically (line feed display) on the tkinter window
- when i tried to upgrade python3 with pyenv, the terminal went wrong
- java - i want to display the input contents in the pull-down when returning with the back button after the springmvc screen tran
- [python] [tkinter] i want to change the acquisition contents of the second and subsequent menu lists by selecting the previous p
- python 3x - unintended behavior of python3 tkinter binding
- python matplotlibpyplot i get an error trying to display a moving average on a candlestick chart
- [python3] inventory management system login and logout do not work
- python3 tkinter i want to be able to input only character strings in a fixed format
- python3 extract and delete duplicate data of date and time
- how to scrape in python and display in a browser?
- python 3x - python3 tkinter toplevel behaves differently than intended
- java - i want to display the contents of a string [] type list
- python 3x - change font size for python3 tkinter entry
- i want to get the value from a constant in python and display it
- introductory to o'reilly japan publishing in the text of python3 (3, 7 larger data structures), "lists, dictionaries, sets
- python - i want to display an image with pysimplegui, but an error occurs
- display images by drag and drop on wxpython gui
- python 3x - i want to get the nth array with an argument using python3 argparse
- excel python i want to get the display result instead of the conditional statement
- python - i want to display the scraping result in the browser
Trends
The changes are as commented.
I think that an error message was displayed when you executed the original code, so check the contents of the error message against the changes.