CSC 9010: Natural Language Processing: Python Intro
CSC 9010: Natural Language Processing: Python Intro
CSC 9010: Natural Language Processing: Python Intro
Processing
Python Intro
>>> x, y = 2, 3
>>> x
2
>>> y
3
>>> “hello”.upper()
‘HELLO’
Start up the interactive Python editor (IDLE) and do the following "finger exercises"
interactively:
1. Set a variable to the string "Hello" Set another variable to the string "World"
Echo your two variables.
2. Add up the numbers 1 to 5 and output their sum.
3. Capture the output of your session and turn it in at the beginning of the next
class.
B. EXPLORING PYTHON
Once you've carried out the above, try some additional things in Python. Work
through the tutorial; or try something new. Make a note of anything that you have
difficulty with or where Python didn't do what you expect. Also turn in a writeup of
what you tried and what comments you have. (You may, but don't have to, turn in the
output of your remaining explorations)
This should be trivial to do; the only real goal of this task is to be sure that you have a
working Python installation and can start and work with the interactive editor.
Based on presentation from www.cis.upenn.edu/~cse391/cse391_2004/PythonIntro1.ppt