#! /usr/bin/env python | |
from stat import * | |
echo 'Which fruit do you like most?' | |
print(r'Which fruit do you like most?') | |
read fruit | |
fruit = raw_input() | |
case $fruit in apple) echo 'Mmmmh... I like those!' ;; banana) echo 'Hm, a bit awry, no?' ;; orange|tangerine) echo $'Eeeks! I dont like those! Go away!' exit 1 ;; *) echo "Unknown fruit - sure it isn't toxic?" esac | |
if ( str(fruit) == 'apple'): print(r'Mmmmh... I like those!') elif ( str(fruit) == 'banana'): print(r'Hm, a bit awry, no?') elif ( str(fruit) == 'orange' or str(fruit) == 'tangerine'): print(r'Eeeks! I dont like those! Go away!') exit(1) else: print("Unknown fruit - sure it isn't toxic?") | |
ÿ |