Try to search your question here, if you can't find : Ask Any Question Now ?

what does [1] works in this snippet of code?what does it mean

HomeCategory: stackoverflowwhat does [1] works in this snippet of code?what does it mean
julie asked 2 weeks ago

i want to store marks in float in list..but when i do this

a_list.append([input("name of students"),float(input("marks scored 
by 
them"))] 
then i got value error

ValueError: could not convert string to float:

what should i do????

this is my whole code..

”’ got input from user in seprate name and marks list then making
them in list of list..”’

a_list = []

for i in range(0, int(input("no of input" ))):
a_list.append([input("name of students"),input("marks scored by 
them")])    

'''to get second highest marks got from list of input by user and 
augment them in list of list'''

second_highest = sorted(list(set([marks for name, marks in 
a_list])))[1]
print('n'.join([a for a , b in sorted(a_list) if b == 
second_highest]))
1 Answers
Best Answer
Arben answered 2 weeks ago
Your Answer

18 + 13 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com