Beginner here. Why is the output “none”? /u/Envixrt Python Education

I mean shouldn’t it sort it in ascending order then print it. The lists tutorials I watched seem to do the same thing but they don’t get this output. Help.

I can’t upload a ss so here’s the code ig.

marks = [] marks.append(input("Enter the marks of student no.1: ")) marks.append(input("Enter the marks of student no.2: ")) marks.append(input("Enter the marks of student no.3: ")) marks.append(input("Enter the marks of student no.4: ")) marks.append(input("Enter the marks of student no.5: ")) marks.append(input("Enter the marks of student no.6: ")) marks.append(input("Enter the marks of student no.7: ")) print(marks.sort()) 

Edit – I know that the value I input would be a string but then it should just sort the string alphabetically right? If I take the same code and sort a list of fruits alphabetically it still shows “none”.

submitted by /u/Envixrt
[link] [comments]

​r/learnpython I mean shouldn’t it sort it in ascending order then print it. The lists tutorials I watched seem to do the same thing but they don’t get this output. Help. I can’t upload a ss so here’s the code ig. marks = [] marks.append(input(“Enter the marks of student no.1: “)) marks.append(input(“Enter the marks of student no.2: “)) marks.append(input(“Enter the marks of student no.3: “)) marks.append(input(“Enter the marks of student no.4: “)) marks.append(input(“Enter the marks of student no.5: “)) marks.append(input(“Enter the marks of student no.6: “)) marks.append(input(“Enter the marks of student no.7: “)) print(marks.sort()) Edit – I know that the value I input would be a string but then it should just sort the string alphabetically right? If I take the same code and sort a list of fruits alphabetically it still shows “none”. submitted by /u/Envixrt [link] [comments] 

I mean shouldn’t it sort it in ascending order then print it. The lists tutorials I watched seem to do the same thing but they don’t get this output. Help.

I can’t upload a ss so here’s the code ig.

marks = [] marks.append(input("Enter the marks of student no.1: ")) marks.append(input("Enter the marks of student no.2: ")) marks.append(input("Enter the marks of student no.3: ")) marks.append(input("Enter the marks of student no.4: ")) marks.append(input("Enter the marks of student no.5: ")) marks.append(input("Enter the marks of student no.6: ")) marks.append(input("Enter the marks of student no.7: ")) print(marks.sort()) 

Edit – I know that the value I input would be a string but then it should just sort the string alphabetically right? If I take the same code and sort a list of fruits alphabetically it still shows “none”.

submitted by /u/Envixrt
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *