Is palindrome

659 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
659
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Is palindrome

  1. 1.  Comment and test out the following code until you COMPLETELY understand it. Do one slide at a time and try to figure it out BY YOURSELF!
  2. 2. One long way:
  3. 3. A shorterway:
  4. 4. An evenshorter way:
  5. 5. What does this line do? ‘python’[::-1] Knowing this, rewrite is_palindrome so that this function is only one line without using any of the previous definitions mentioned! This would make it the shortest way of writing this function.
  6. 6. Adding SwampyStep ONE: Download the swampy zipfilefrom our course websiteStep TWO:Unzip it to somewhere easy toaccess in your home (h:) driveStep THREE :Go to your desktop > right clickon ‘my computer’ > properties> advanced tab > environmentvariables > click ‘new’ underuser variables
  7. 7. Adding SwampyStep FOUR:Under variable name type:PYTHON PATHUnder variable value type:H: [AND THEN THE PATH YOUSAVED IT TO]Step FIVE:Restart python.Step SIX:To check if you did itcorrectly, in the Python Shelltype in:From TurtleWorld import *If that didn’t’give you anerror, you are good to go!

×