User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 391,596 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,706 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser:
Views: 53389 | Replies: 158
Reply
Join Date: Aug 2005
Posts: 1,004
Reputation: Ene Uran is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 64
Ene Uran's Avatar
Ene Uran Ene Uran is offline Offline
Veteran Poster

Re: Projects for the Beginner

  #131  
Aug 9th, 2007
  1. # This is text from a file I found. Write a Python program to
  2. # convert the text into a dictionary with "state": "motto" pairs
  3. # something like {"Alabama": "At Least We're not Mississippi",
  4. # "Alaska": "11,623 Eskimos Can't be Wrong!", ...}
  5. #
  6. # Then write a program that allows you to enter the state and
  7. # it will display the motto of that state.
  8.  
  9. state_mottos = """\
  10. Alabama: At Least We're not Mississippi
  11.  
  12. Alaska: 11,623 Eskimos Can't be Wrong!
  13.  
  14. Arizona But It's a Dry Heat
  15.  
  16. Arkansas: Litterasy Ain't Everthing
  17.  
  18. California: As Seen on TV
  19.  
  20. Colorado: If You Don't Ski, Don't Bother
  21.  
  22. Connecticut: Like Massachusetts, Only Dirtier and with less Character
  23.  
  24. Delaware: We Really Do Like the Chemicals in our Water
  25.  
  26. Florida: Ask Us About Our Grandkids
  27.  
  28. Georgia: We Put the 'Fun' in Fundamentalist Extremism
  29.  
  30. Hawaii: Haka Tiki Mou Sha'ami Leeki Toru (Death to Mainland
  31. Scum, But Leave Your Money)
  32.  
  33. Idaho: More Than Just Potatoes... Well Okay, Maybe Not, But
  34. The Potatoes Sure Are Good
  35.  
  36. Illinois: Please Don't Pronounce the "S"
  37.  
  38. Indiana: 2 Billion Years Tidal Wave Free
  39.  
  40. Iowa: We Do Amazing Things With Corn
  41.  
  42. Kansas: First Of The Rectangle States
  43.  
  44. Kentucky: Five Million People; Fifteen Last Names
  45.  
  46. Louisiana: We're Not All Drunk Cajun Wackos, But That's Our Tourism Campaign
  47.  
  48. Maine: We're Really Cold, But We Have Cheap Lobster
  49.  
  50. Maryland: A Thinking Man's Delaware
  51.  
  52. Massachusetts: Our Taxes Are Lower Than Sweden's (For Most Tax Brackets)
  53.  
  54. Michigan: First Line of Defense From the Canadians
  55.  
  56. Minnesota: 10,000 Lakes and 10,000,000 Mosquitoes
  57.  
  58. Mississippi: Come Feel Better About Your Own State
  59.  
  60. Missouri: Your Federal Flood Relief Tax Dollars at Work
  61.  
  62. Montana: Land of the Big Sky, the Unabomber, Right-Wing Crazies, and
  63. Very Little Else
  64.  
  65. Nebraska: Ask About Our State Motto Contest
  66.  
  67. Nevada: Whores and Poker!
  68.  
  69. New Hampshire: Go Away and Leave Us Alone
  70.  
  71. New Jersey: You Want a ##$%##! Motto? I Got Yer ##$%##! Motto Right Here!
  72.  
  73. New Mexico: Lizards Make Excellent Pets
  74.  
  75. New York: You Have the Right to Remain Silent, You Have the Right to
  76. an Attorney...
  77.  
  78. North Carolina: Tobacco is a Vegetable
  79.  
  80. North Dakota: We Really are One of the 50 States!
  81.  
  82. Ohio: We Wish We Were In Michigan
  83.  
  84. Oklahoma: Like the Play, only No Singing
  85.  
  86. Oregon: Spotted Owl... It's What's For Dinner
  87.  
  88. Pennsylvania: Cook With Coal
  89.  
  90. Rhode Island: We're Not REALLY An Island
  91.  
  92. South Carolina: Remember the Civil War? We Didn't Actually Surrender
  93.  
  94. South Dakota: Closer Than North Dakota
  95.  
  96. Tennessee: The Educashun State
  97.  
  98. Texas: Si' Hablo Ingles
  99.  
  100. Utah: Our Jesus Is Better Than Your Jesus
  101.  
  102. Vermont: Yep
  103.  
  104. Virginia: Who Says Government Stiffs and Slackjaw Yokels Don't Mix?
  105.  
  106. Washington: Help! We're Overrun By Nerds and Slackers!
  107.  
  108. Washington, D.C.: Wanna Be Mayor?
  109.  
  110. West Virginia: One Big Happy Family -- Really!
  111.  
  112. Wisconsin: Come Cut Our Cheese
  113.  
  114. Wyoming: Wynot?
  115. """
Last edited by Ene Uran : Aug 9th, 2007 at 5:15 pm. Reason: it will
drink her pretty
Reply With Quote  
Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,394
Reputation: vegaseat will become famous soon enough vegaseat will become famous soon enough 
Rep Power: 9
Solved Threads: 172
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
Kickbutt Moderator

Re: Projects for the Beginner

  #132  
Aug 16th, 2007
Write an anagram program that takes someone's name and uses all the letters to create a phrase, for instance:
Osama Bin Laden --> 'bad neon salami'
George W Bush --> 'whose bugger'
George Bush --> 'he bugs Gore'
Tony Blair --> 'bony trail'
Ronald Reagan --> 'loan arranged'
David Letterman --> 'nerd amid late TV'
Elvis --> 'lives'

... beyond names:
The Morse Code --> Here Come Dots
Slot Machines --> Cash Lost in'em
Mother-in-law --> Woman Hitler
Statue of Liberty --> Built to Stay Free
New York Times --> Monkey writes
eleven plus two --> twelve plus one

You could also write a Python program that checks the above anagrams for correctness.
Last edited by vegaseat : Sep 4th, 2007 at 1:08 pm. Reason: more spelling
May 'the Google' be with you!
Reply With Quote  
Join Date: Jul 2005
Location: France
Posts: 965
Reputation: bumsfeld is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 42
bumsfeld's Avatar
bumsfeld bumsfeld is offline Offline
Posting Shark

Re: Projects for the Beginner

  #133  
Sep 2nd, 2007
Something little more entertaining:
Write program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number, and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.
Last edited by bumsfeld : Sep 2nd, 2007 at 3:59 pm.
Should you find Irony, you can keep her!
Reply With Quote  
Join Date: Feb 2007
Location: St. Vincent and the Grenadines, Caribbean
Posts: 947
Reputation: scru is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 39
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Shark

Re: Projects for the Beginner

  #134  
Sep 5th, 2007
Topic: Encryption

#1 Write a program that that encrypts a string based on a alphanumeric key input by the user (or a number for a step encrypt program).

#2 enhance your program in #1 so that is the encrypted output is different every time, but can still be decrypted with the key.

#3 Modify the program in #2 so that it can handle private/public keys.

#4Write a script that can generate private and public keys for use with #3

#5 Write a program that can look for patterns in and break simple encryptions. Test it on #1, #2 and #3 (but do not write it based on your knowledge of howw they work). Be sure to set timouts, ie., if your loops exceed a certain amount of runs, force to program to stop, instead of hanging.

In the above:
Think of an innovative way to use dictionaries in any/all.

the random module will help in #2. But using it incorrectly will yield an undesired result. A bit of thinking and planning would be required. Perhaps there is way way to do this without random. Can you think of it?

char() and ord() functions in python are useful.

Comment your code, and use meaningful variable names. You will soon find that your program will swell at a rapid rate and otherwise understanding will be difficult. It is also a good practise to employ regardless what what you program
Last edited by scru : Sep 5th, 2007 at 5:45 pm.
Reply With Quote  
Join Date: Dec 2007
Posts: 6
Reputation: tomoconnell is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tomoconnell tomoconnell is offline Offline
Newbie Poster

Re: Projects for the Beginner

  #135  
Dec 17th, 2007
I am having a problem with the green highlighted
items that appear in your text
How do I get " what looks like a magnifying glass
followed by code" and "what looks like a magnifying glass followed by keywords"

I still don't understand how to put that in my code. How is it done? Do I have to have some special test tool?
Reply With Quote  
Join Date: Oct 2006
Posts: 1,159
Reputation: sneekula is on a distinguished road 
Rep Power: 4
Solved Threads: 37
sneekula's Avatar
sneekula sneekula is offline Offline
Veteran Poster

Re: Projects for the Beginner

  #136  
Dec 19th, 2007
That is one of the more nauseating features added by DaniWeb. It brings up unwanted advertisement from certain words.

Editor's note ...
To get rid of the green IntelliText, follow this path:
User Control Panel
Edit Options
Miscellaneous Options
Disable IntelliTXT
Last edited by vegaseat : Dec 27th, 2007 at 3:37 pm. Reason: intellitext
No one died when Clinton lied.
Reply With Quote  
Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,394
Reputation: vegaseat will become famous soon enough vegaseat will become famous soon enough 
Rep Power: 9
Solved Threads: 172
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
Kickbutt Moderator

Re: Projects for the Beginner

  #137  
Jan 8th, 2008
Write a Python program that calculates pi to a precision of 100 decimal places.
May 'the Google' be with you!
Reply With Quote  
Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,394
Reputation: vegaseat will become famous soon enough vegaseat will become famous soon enough 
Rep Power: 9
Solved Threads: 172
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
Kickbutt Moderator

Re: Projects for the Beginner

  #138  
Jan 11th, 2008
Write a Python program that converts the string 'supercalifragilisticexpialidocious' to the string 'SuPeRcAlIfRaGiLiStIcExPiAlIdOcIoUs'.
May 'the Google' be with you!
Reply With Quote  
Join Date: Jan 2008
Posts: 18
Reputation: Begjinner is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Begjinner's Avatar
Begjinner Begjinner is offline Offline
Newbie Poster

Solution Re: Projects for the Beginner

  #139  
Jan 27th, 2008
Make a small plug-in (extension) with Python that for example opens a (new) file in one of the following free programs:

* Blender (3D modeling)
* The Gimp (2D editing)
* Inkscape (vector editing)
* OpenOffice (office suite)


Some info links:

Blender:
http://www.blender.org/
http://jmsoler.free.fr/didacticiel/b...cript00_en.htm

The Gimp
http://www.gimp.org/
http://www.jamesh.id.au/software/pygimp/

Inkscape
http://www.inkscape.org
http://www.inkscape.org/screenshots/...n&version=0.42

OpenOffice
http://www.openoffice.org/index.html
http://wiki.services.openoffice.org/wiki/Python
http://udk.openoffice.org/python/python-bridge.html
Last edited by Begjinner : Jan 27th, 2008 at 6:25 am.
Reply With Quote  
Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,394
Reputation: vegaseat will become famous soon enough vegaseat will become famous soon enough 
Rep Power: 9
Solved Threads: 172
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
Kickbutt Moderator

Re: Projects for the Beginner

  #140  
Jan 27th, 2008
Write a Python program that asks the user a series of multiple choice questions about preferences (hair, eyes, figure, food, car, vacation, music, sport, fun etc.), and then picks a date from a number of celebreties. You might have to do some googling.
May 'the Google' be with you!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Python Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Python Forum

All times are GMT -4. The time now is 11:35 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC