Python Forum
Thread Rating:
  • 2 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spell Checker
#2
You're starting at the top. You've got the framework listed in the last bullet point without the pieces listed in the first two parts. Start at the bottom, and write the first two parts.

First you need to convert the string input to a list. From the description, your input is going to look like this:

Output:
adress:address alot:a lot athiest:atheist noone:no one
Convert that text into a list of lists as specified. Point 1 spells out exactly how to do it.

Then write the checkWork (checkWord?) function as described. You are going to want to loop through the list of lists like this:

e = [[2, 7], [1, 8], [2, 8]]
for first, second in e:
    print(first + second)
This is called tuple assignment. The first time through the loop, it will pull the sub-list [2, 7] out of e, and assign that to first, second, sort of like this:

first, second = [2, 7]
Python can handle having two items on the left of the assignment, as long as two items are on the right. It will assign the 2 to first and the 7 to second.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Spell Checker - by Liquid_Ocelot - May-07-2017, 06:14 AM
RE: Spell Checker - by ichabod801 - May-07-2017, 11:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Password Checker Assignment mcostello 1 5,204 Nov-14-2020, 07:54 AM
Last Post: DPaul
  Palindrome checker case sensive edwdas 3 2,739 Nov-07-2019, 05:57 PM
Last Post: nilamo
  "Travis" guest list name checker (Ziyad Yehia Udemy course) Drone4four 8 4,116 Aug-24-2019, 03:46 PM
Last Post: jefsummers
  Syntax checker BZA 4 3,276 May-16-2019, 06:40 PM
Last Post: BZA

Forum Jump:

User Panel Messages

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