| #! /usr/bin/env python | |
| from stat import * | |
echo 'Which fruit do you like most?' | |
print("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 ( fruit == 'apple'):
print("Mmmmh... I like those!")
elif ( fruit == 'banana'):
print("Hm, a bit awry, no?")
elif ( fruit == 'orange' or fruit == 'tangerine'):
print("Eeeks! I dont like those! Go away!")
exit(1)
else:
print("Unknown fruit - sure it isn't toxic?") | |
ÿ |