We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Basic Data Types
- Nested Lists
- Discussions
Nested Lists
Nested Lists
Sort by
recency
|
4759 Discussions
|
Please Login in order to post a comment
My Solution:
if name == 'main': nested = [] n = range(int(input())) for _ in n: name = input() score = float(input()) nested.append([name, score]) sorted_nest = sorted(nested, key=lambda x: x[1])
My Solution:
My solution:
if name == 'main': grades = [] for _ in range(int(input())): name = input() score = float(input()) grades.append([name, score])
def sort_student(name_score): score=[] for student in name_score: score.append(student[1])
if name == 'main': name_score = [] for _ in range(int(input())): name = input() score = float(input()) name_score.append([name,score])