Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Name: Ayaan Kushwah
- # Roll No: 250246
- # Contact: 9211929151, [email protected]
- import csv
- file = open(r"C:\Users\DELL 5420\Downloads\Asteroids.csv", 'r', newline = "\r\n")
- reader = csv.reader(file)
- sun_distance = []
- for row in reader:
- sun_distance.append(row)
- sun_distance.sort(key = lambda x: (x[1]))
- length = len(sun_distance)
- for i in range (length - 1, length - 12, -1):
- print(sun_distance[i][0] ,",", sun_distance[i][1], ",", sun_distance[i][2] )
- file.close()
Advertisement
Add Comment
Please, Sign In to add comment