Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 30th, 2002, 06:21 PM
Potato_Tempest Potato_Tempest is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 0 Potato_Tempest User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry I CANT FIGRE OUT WHATS WRONG!!! aRRG!!

here's the program, I'm reading a tutorial on Python, and im trying to write a program, but this has errors and i dont know whats wrong. Anyone help?

Code:

#print menu
    print "Area Caculation Program"
    print "-----------------------"
    print
    print "Select a shape"
    print "1. Rectangle"
    print "2. Circle"
    print "3. Triangle"
    print "4. Trapazoid"


shape = input()

    #get area

if shape == 1:
        print "Area of a Rectangle
        print "---------------"
        print
        length = input("Please input length")
        width = input("Please input width")
        area = length*width
        print "the area is", area

elif shape == 2
        print "Area of a Circle
        print "---------------"
        print
        radius = input("Please input the radius")
        area = (3.14*radius)radius
        print "The area is", area

elif shape == 3
        print "Area of a Triangle"
        print "------------------"
        print
        length = input("Please input length")
        width = input("Please input width")
        area = .5(length*width)
        print "The area is", area

elif shape == 4
        print "Area of a Trapazoid"
        print "-------------------"
        print
        length = input("Please input length")
        b = input("Please input the first width")
        c = input("Please input the second width")
        area = .5length(b+c)
        print "The area is", area

Reply With Quote
  #2  
Old February 1st, 2002, 03:23 AM
Taradino Taradino is offline
Python Prophet
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Amersfoort, The Netherlands
Posts: 45 Taradino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
I can't figure out what's wrong either.

If I don't know what errors you get, I can't help you, although I do have a tip:
don't use input(), but use raw_input(), and then convert it to an int, like this:
int(raw_input()). Take a look here, part 4.12. It's a great book, btw.
__________________
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. - Jamie Zawinski, in comp.lang.emacs

Reply With Quote
  #3  
Old February 1st, 2002, 03:06 PM
Potato_Tempest Potato_Tempest is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 0 Potato_Tempest User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
it's alright, i found out whats wrong, i just forgot some :'s and *'s. Anyway I fixed it, and now it works fine. Ill check out that link anyway though, thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > I CANT FIGRE OUT WHATS WRONG!!! aRRG!!

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap