0

Hi! I'm writing a program that will take a an inputed phrase, assigns each letter to a picture of the letter from a file, and outputs the given phrase, looking like a ransom note.
I have a start, but I'm not really sure where to go next. I've only just learned the language, so take it easy on me. :)

`

from graphics import *

def main():
    win = GraphWin("Ransom Note", 500, 500)

    phrase = input("Enter your note: ")
    phrase.lower()

    w = str(phrase[int(q)]) #for the name of each picture file

    space = 4

    for i in letter():
        letter[int(q)+0] = Image(Point(x,y), w.gif) #q is the placement of the letter in the string
        letter[1] = Image(Point(x + (phrase[0].getWidth()/2) + space + (phrase[1]/2)), q.gif)

main()

`

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by woooee
0

but I'm not really sure where to go next

That is too vague to understand what you mean. Draw the whole thing out on paper, breaking it into steps. Also, add some print statements to help with debugging. You are using
for i in letter():
for example and the variable "letter" has not been declared so your program will not run as is. If you do not know what to do, it generally means that you do not know enough about Python to solve this particular problem and should pick something else.

Edited by woooee

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.