Python Forum
Need help with a tough school assignment
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with a tough school assignment
#6
Just glancing at the code, I would say don't eval the input, that will just cause name errors. Also, on line 5, you are comparing one character of guessword to the whole of userinput, so I doubt that ever works correctly. Finally, note that maskString is twice as long as guessword. So you can't use indexes on that the way you are using indexes on the other words.

That brings me to something that is bad coding practice, although it may not be preventing you code from working. You should iterate over the strings, not the indexes of the strings, as shown here.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Need help with a tough school assignment - by ichabod801 - Feb-18-2019, 06:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  School Work Assignment: Snake Game DarksideMoses 6 5,156 Apr-29-2018, 10:56 PM
Last Post: DarksideMoses
  Array to get profit (school assignment) harryvandervelden 2 2,820 Nov-28-2017, 05:48 PM
Last Post: Larz60+
  School assignment Ronaldo 5 9,100 Jan-08-2017, 11:57 AM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020