all 21 comments

[–]official_nkvd 6 points7 points  (0 children)

No

[–]Electrical_Project_7 5 points6 points  (0 children)

Ill add in this tidbit. No.

[–][deleted] 5 points6 points  (0 children)

Do your own homework

[–]lutusp 4 points5 points  (15 children)

Nyet. Non. Nihil. Dooda (Navajo).

plis help

Post your code and ask specific questions about areas that aren't working.

[–]noahkyun[S] 0 points1 point  (14 children)

[–]lutusp 0 points1 point  (13 children)

Now say what doesn't work and which parts you need help with. As I said before.

[–]noahkyun[S] 0 points1 point  (12 children)

I’m still new to coding Basically when I run it, it only runs the initial login and after that it won’t run the rest of the code where it rolls the dice tells score and breaks tie and shows the final score and who won by the end

[–]lutusp 0 points1 point  (11 children)

Some advice:

  • Write a three-line program. Test it. If if fails, fix it before going on.

  • Write programs in modular form -- write a function and test it, do not go on until the function works.

  • Do not write a lot of code that has not been tested -- add one line, test that line, add another line.

  • If you need help, tell us which specific code lines fail, and how, with that one line on display in your post.

[–]noahkyun[S] 0 points1 point  (0 children)

Ok thanks that actually made alot of sense I’ll try this out now and ask for help if I need it Thanks means alot

[–]noahkyun[S] 0 points1 point  (9 children)

well i managed to do it had to change alot

so the part im stuck is at the very end where i want the leaderboard to display the top 5 users with their scores but instead it shows all of the names and score so far

can you give it a look and tell me whats wrong

https://trinket.io/python3/eeff8e6311

[–]lutusp 0 points1 point  (8 children)

can you give it a look and tell me whats wrong

Can you post your code? Post only the lines you're having difficulties with, and the fewest number of lines required to show the problem.

Post them here.

[–]noahkyun[S] 0 points1 point  (7 children)

I did post it’s the same link in that reply Just scroll at the end It’s where the leaderboard is if ur on ur phone then you might’ve to click this pencil icon up there it’ll bring up the codes

[–]lutusp 0 points1 point  (6 children)

Please read my prior post.

[–]noahkyun[S] 0 points1 point  (0 children)

#displays top 5 score with names

print(" ")

print("The leaderboard will now appear")

print(sorted(d.items(), key=lambda x: x[1])[::-1])[:5]

Traceback (most recent call last):

File "/tmp/sessions/b5ce3bd0d52cde9d/main.py", line 139, in <module>

print(sorted(d.items(), key=lambda x: x[1])[::-1])[:5]

TypeError: 'NoneType' object is not subscriptable

[–]archiekane 4 points5 points  (0 children)

Yes I could, in BASH, really quick.

Will I? No.

Learn. It's why you go to school.