Solution needed! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Solution needed!

Not showing all outputs. What to do? Click here to see ⤵️ https://code.sololearn.com/cKQmxZxB69F3/?ref=app

21st Nov 2022, 6:38 AM
Mustakim Rahman
Mustakim Rahman - avatar
10 Answers
+ 4
Now the problem solved (cheers)! i used [ ] instead of () .. So error occured!
21st Nov 2022, 12:00 PM
Mustakim Rahman
Mustakim Rahman - avatar
+ 7
Java tag is not related to question. Edit to python. You may trying copy? It just assignment like new_list = original_list // is this what you looking?
21st Nov 2022, 7:54 AM
Jayakrishna 🇮🇳
+ 3
Please put Python in post tags. Currently it has Java in tags, while the issue actually is related to a Python code.
21st Nov 2022, 7:50 AM
Ipang
+ 3
[ ] braces used for indexing. ( ) used for function call new_list = list[original_list] #here list is a type, which is not subscriptable or indexing. so error
21st Nov 2022, 11:50 AM
Jayakrishna 🇮🇳
+ 2
maybe you mean new_list = list(original_list)
21st Nov 2022, 11:26 AM
Bob_Li
Bob_Li - avatar
+ 2
But my question is why type error and how to solve that?
21st Nov 2022, 11:45 AM
Mustakim Rahman
Mustakim Rahman - avatar
+ 1
Mustakim Rahman Try to read the output error message.... What is say?
21st Nov 2022, 6:46 AM
KrOW
KrOW - avatar
+ 1
It showing type error!
21st Nov 2022, 6:50 AM
Mustakim Rahman
Mustakim Rahman - avatar
+ 1
Mustakim Rahman It show you the line (74) and the error ('type' object is not subscriptable). In particular the line is: new_list = list[original_list] 'list' is a type as str, int and dict.... And you using index on it (i dont think that is what you want)
21st Nov 2022, 7:01 AM
KrOW
KrOW - avatar
+ 1
Mustakim Rahman The error, as previously said, is "type object is not subscriptable" because you trying to use subscription syntax on invalid type (list IS a type object not a list object)...What you dont understand?
21st Nov 2022, 11:54 AM
KrOW
KrOW - avatar