Lecture Notes on 12 Oct 2009 # This program prompts the user to enter the starting hour and the # duration of the event and it will show when the event will end def main(): hr = input ("Enter starting hour: ") evt = input ("Enter duration of event in hours: ") time = (hr - 1 + evt) % 12 + 1 print "At the end of the event, the hour hand will show = ", time main() # This program prompts the user to enter the string and a shift # It then prints the encrypted the string def encrypt (st, shift): newSt = "" for ch in st: if (ch.islower()): newCh = chr((ord(ch) - ord('a') + shift) % 26 + ord('a')) else: newCh = ch newSt = newSt + newCh return newSt def main(): st = raw_input ("Enter a string: ") st = st.strip() shift = input ("Enter shift: ") print encrypt (st, shift) main()