Page 8 of 8 FirstFirst ... 678
Results 71 to 74 of 74

Thread: Computery questions

  1. #71
    Darth Small Macheath's Avatar
    Join Date
    Sep 2010
    Posts
    15,638
    Quote Originally Posted by Gnorlin View Post
    you'll have to quote my post and copy/past from there to get the proper formatting if you intend to actually run the script. Tabs are very important in Python and 0% important in HTML.
    Just use a [code] block:

    Code:
    dict = {}
    start = ord('a')
    
    for i in range(0, 26):
        dict[chr(start+i)] = (i % 13) + 1;
    
    while True:
        word = input( "enter a word: " )
        
        count = 0;
        for char in word:
            count = count + dict[char]
            
        print( "total: " + str(count) )

  2. #72
    Senior Member
    Join Date
    Sep 2010
    Posts
    3,778
    Thank you both very muchly. We did manage to find "zoologist" equals 60. I'm not quite sure what this lesson teaches, but it was hard.

  3. #73
    Senior Member
    Join Date
    Sep 2010
    Posts
    3,778
    Of course that page is blocked on his school chromebook, but we used it on my computer. Good thing the school blocks sites that allow kids to learn programming.

  4. #74
    Darth Small Macheath's Avatar
    Join Date
    Sep 2010
    Posts
    15,638
    Just google "python online" or something. There's a browser based interpreter right on python.org (copy, paste, hit enter):
    Attached Images Attached Images

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •