File code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

File code

There’s something wrong within it, but I’m not sure what. Link: https://sololearn.com/compiler-playground/cHiEKo5SOjfT/?ref=app

19th Sep 2023, 9:54 PM
Annihilate
Annihilate - avatar
7 Answers
+ 1
ok, so i ran this on a pc and i get the same thing: "None" so i tried removing the .get('PYTHONSTARTUP') and it returned a dictionary. which means that there are some environment variables in Sololearn, but there is no "PYTHONSTARTUP" in those variables you can do: print(os.environ) and see what is available to you. what are you trying to do with the code?
29th Sep 2023, 1:01 AM
Aaron Lee
Aaron Lee - avatar
+ 1
I read the comments between you and Rain. Have you tried this code in an IDE on your machine? If it works in that case, then I'd assume there are no accessible environment variables through sololearn's py compiler, So it will only ever return "None"
20th Sep 2023, 12:23 AM
Aaron Lee
Aaron Lee - avatar
+ 1
I thought it would extract something from that dictionary
29th Sep 2023, 8:40 PM
Annihilate
Annihilate - avatar
0
I don’t even have ID(L)E
20th Sep 2023, 11:15 PM
Annihilate
Annihilate - avatar
0
I’m on a mobile device
28th Sep 2023, 11:20 PM
Annihilate
Annihilate - avatar
0
If that dictionary had the key "PYTHONSTARTUP", it would extract that, but it doesn't do so you get "None"
29th Sep 2023, 9:59 PM
Aaron Lee
Aaron Lee - avatar
0
Hmm, ok
30th Sep 2023, 6:33 PM
Annihilate
Annihilate - avatar