On an analog clock calculate the angle between the hour hand and the minute hand at a given time of hh:mm, let's say 11:25.

Would you take a job that goes for 14 days, where on the first day you make 1 cent, on the second day you double to 2 cents, on the third day you double this to 4 cents and so on?

The average distance between Earth and Sun is about 150 million kilometers (93 million miles). Write a Python program the calculates the speed (km/hr or miles/hr) the Earth has around the Sun.

The speed of light is 300,000 kilometers per second (186,282 miles per second). Assume the Earth-Sun distance is 150 million kilometers (93 million miles). How long does light from the Sun take to reach the Earth?

#this program is a simple yet powerful implementation of basic ceaser cypher in python by Shakeel Osmani
alphabets = ["a","b","c","d",
             "e","f","g","h",
             "i","j","k","l",
             "m","n","o","p",      #sets up the alphabet list
             "q","r","s","t",
             "u","v","w","x",
             "y","z"]
mode = raw_input("Choose a mode whether to encrypt or decrypt: e for encrypt and d for decrypt: ") #ask whether to encrypt or decrypt
x = raw_input("enter the word : ")
y = int(raw_input("enter the no between 1-26: ")) #as ceaser cypher the key can be between 1 - 26 (no of english alphabets)
if mode == "d":
    y = -y            #(incase of decryption the key has to be just -key for example if key was 3 should become -3)
count = 0 #(this one to keep track of for loop which loops for the number of character in the word)
counter = 0 #(this one for the while loop to get the position of the letter in alphabet like a = 0, b = 1 , c=2 ....)
alpcount = 0 #(another similar counter to match the found characters position is alphabet)
output = "" # just an output string variable
for a in x:
    char = x[count] #(to find the position of each character)
    counter = 0  #----> this is important , we reset counter 0 as after one character is processed we need to make counter 0 and start again
    while (counter < 26):
        if char == alphabets[counter]:#if the charcter matches one of the alphabet then find the position of the character in alphabet
            newval = counter + y #to encrypt or decrypt add the value of y to characters position
            if newval > 26: # while adding if value is greater than 26 then we need to reset by deducting 26
                newval = newval - 26
            newchar = alphabets[newval]
        counter += 1
    output += newchar #this line here if we do not do we will get result as individual characters not as a string                              
    count += 1   # rest all is self-explanatory we are just completing all the loops we created
if mode == "d":
    print "the decrypted word with key %d is : %s " %(-y , output)
elif mode == "e":
    print "the encrypted word with key %d is : %s " %(y , output)  

# I had written same algorithm few months back in c++, the program was so much difficult because python supports lists data type
# the list of alphabets on top , code becomes so easy and powerful :)

Use the Python module decimal to show that the result of 1/61
has a period of 60 (repeats every 60 digits),
also every digit appears 6 times in the period.

Develop an mp3 player using the pygame's mixer module with a GUI interface with buttons for browsing the file (Filedialog module of Tkinter) and other buttons for play, pause and stop. You can also go ahead with a time display as a label to measure the time for which the song has been playing. Later additions may also include some pictures or a song queue like a playlist and other fun stuff. For MP3 and MIDI playing using pygame refer to vegaseat's code as posted in the thread
http://www.daniweb.com/software-development/python/code/454835/let-pygame-play-your-midi-or-mp3-files

A football league simulator with 10 teams each of 15 players. Simulate each match in a randomly generated schedule and decide the winner using the attributes of the team and a probability function which basicall decides the winner or if the game is draw on an equal basis for teams with equal strength. Make the league more funky with your own imaginative teams and imaginative players. Expand the game with many such repetitions of the schedule and finally declare a winner based on the points each team has scored.

Imagine you were working for the government security agency and had to read large amounts of your fellow citizens' emails. Create a Python program that will help you to find certain words or combination of words to indicate foul play.

commented: nice project haha +4

A small game like a point and shoot adventure using the Pygame module of Python.
Make enemy characters appear at random in certain spots in your screen(say a building) and pick them off with your awesome shooting skills!

Few ideas - Palindrome tester, lottery number generator, degrees to farenheight convertor, Blackjack, battleships, password strength tester, perfect number tester, prime number tester.

a=
a=10
b=20
a+b
c=a+b
c

Top Trumps in Tkinker with assistance from the random module! Make so its simple to add other sets of Top Trump sets as other game modes.

Make a word translator for English to Spanish or some other language of your choice. That should keep you busy for quite some time.

Data mining of large amounts of text (like e-mails or tweets) for certain keywords or key phrases.

Great thread, thanks all for this.

Here's one toy script I'm going to write when I'm ready: convert a number expressed in decimal digits to a number expressed in a standard way in English words, and vice-versa. (For example, convert 2,733.89 to "two thousand, seven hundred and thirty-three point eight nine" and vice-versa.)

Write a Python program that goes through a given text and gives the number of the longest words and the average length of all words.

commented: good motivation +1

This is off the top of my head and probably buggier than anything:

#! usr/bin/env python3

import string

# assume variable "text" has already been defined

text_set = set(text.slice())
word_lengths = set(len(text.set[x]) for text_set)
# I forget the method for the largest number; call it "largest"
longest_word = word_lengths.largest()

text_list = [text.slice()]
word_lengths_list = [len(x) for x in len(text_list)]
total_length =+ word_lengths_list[x] for len(word_lengths_list)
average_word_length = total_length / len(word_lengths_list)


# ouptut longest_word and average_word_length

Editor's note:
Please follow the rules as mentioned in the start of this thread. If you have questions, start your own thread and don't clutter the sticky.

Calculate the area of a regular polygon given side_length s and number of sides n.

Also if you had
s = 0.01
n = 1000
which approaches a circle. What would the radius of that circle be?

Here is an answer that contains no syntax errors or exceptions but appears to contain semantic errors. Maybe someone could help out:

#! /usr/bin/env python3

def calculate_area(n, s):
    """calculate area of regular polygon given external input n = number of sides
       and s = length of each side; returns the area as a float"""

    from math import tan

    return n * s ** 2 / 4 / tan(180 / n)

Editor's note:
Please follow the rules as mentioned in the start of this thread. If you have questions, start your own thread and don't clutter the sticky.

@farmwife: replace 180 with math.pi. Trigonometric functions use radians.

To add to the comment of Gribouillis: to convert from degrees to radians use math.pi/180 For an angle of 90° that would give Math.pi/2.

The rules as listed in the beginning of this thread:

This sticky is dedicated to a list of just such projects.

If you know a good project, please post it here. If you have questions, start your own thread and don't clutter the sticky. Please do not post your answeres in here!

Write a Python program that calculates the area or surface area of a number of well known shapes like hexagon, cube, pyramid, circle, cone, sphere, cylinder, and so on.

Also, remember that trig functions use angles in radians. The math module helps with ...
math.degrees(x) converts angle x from radians to degrees
math.radians(x) converts angle x from degrees to radians

Find all the duplicate words in a text.

Write a Python program that gives this result:

                                       1
                                  1    2    1
                             1    2    4    2    1
                        1    2    4    8    4    2    1
                   1    2    4    8   16    8    4    2    1
              1    2    4    8   16   32   16    8    4    2    1
         1    2    4    8   16   32   64   32   16    8    4    2    1
    1    2    4    8   16   32   64  128   64   32   16    8    4    2    1

Write a smart AI for simple games such as Tic-Tac-Toe or Poker.

Create a password generator.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.