Python Forum
Need help explaining what the variables do in my code.
Thread Rating:
  • 3 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help explaining what the variables do in my code.
#1
Hello I'm learning Python at school and have been set a task,

Task 1


Develop a program that analyses a sentence that contains several words without punctuation. When 
a word in that sentence is input, the program identifies all of the positions where the word occurs in 
the sentence. The system should not be case sensitive: Ask, ask, ASK should be treated as the same 
word.
For example, in the sentence 
ASK NOT WHAT YOUR COUNTRY CAN DO FOR YOU ASK WHAT YOU CAN DO FOR YOUR 
COUNTRY
The word ‘COUNTRY’ occurs in the 5th and 17th positions.
Analyse the requirements for this system and design, develop, test and evaluate a program to locate 
and return the position(s) of the word you have selected in a particular sentence or return an error 
message if the word is not in the sentence.

however my teacher has been off for the past 1-2 weeks due to a bad back and therefore I have had multiple supply teachers. I have written my code and it is working but now I have to do a write up explaining what my the variables are in my code and what they do, can somebody explain to me why am I using these certain variables or give me advice on what to write? Thank you

This is a screenshot of my code so far
[Image: ?ui=2&ik=635a3fea80&view=fimg&th=159d532...&zw&atsh=1]
Reply


Messages In This Thread
Need help explaining what the variables do in my code. - by BurnedChipotle - Jan-26-2017, 09:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Explaining "translate" method lummers 4 2,389 Jan-13-2020, 06:31 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

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