Difference between revisions of "CSC111 Homework 7 Solution"
(Created page with '--~~~~ ---- <source lang="python"> # Eliza1.py # D. Thiebaut # edited by Kristina Fedorenko # 111c - aq # # a very simple eliza-like program # # 1) greet user # react if us…') |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
--[[User:Thiebaut|D. Thiebaut]] 14:09, 30 March 2010 (UTC) | --[[User:Thiebaut|D. Thiebaut]] 14:09, 30 March 2010 (UTC) | ||
---- | ---- | ||
− | + | <onlydft> | |
<source lang="python"> | <source lang="python"> | ||
Line 31: | Line 31: | ||
from logging111 import Print | from logging111 import Print | ||
from logging111 import Raw_input | from logging111 import Raw_input | ||
+ | |||
+ | #Note: if you do not have a logging111.py module, simply replace | ||
+ | # Print by print, and Raw_input by raw_input is the program, and it | ||
+ | # should work fine. | ||
+ | # | ||
# -------------------------------------------------------------------------- | # -------------------------------------------------------------------------- | ||
Line 181: | Line 186: | ||
user_greet = formatInput() | user_greet = formatInput() | ||
isGreeting = checkSentence(user_greet, greetings) | isGreeting = checkSentence(user_greet, greetings) | ||
− | if isGreeting : returnCan(ProgGreet) | + | if isGreeting : |
− | else : returnCan(ProgScold) | + | returnCan(ProgGreet) |
+ | else : | ||
+ | returnCan(ProgScold) | ||
Line 272: | Line 279: | ||
</source> | </source> | ||
+ | </onlydft> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | <br /> | ||
+ | [[Category:CSC111]][[Category:Homework]][[Category:Python]] |