School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,149 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,710 people online right now. Registration is fast and FREE... Join Now!




tree diamiter

 

tree diamiter

chrishaizimsque

11 Oct, 2009 - 11:25 PM
Post #1

New D.I.C Head
*

Joined: 11 Oct, 2009
Posts: 5


My Contributions
# ncit 106 - week 3 -a3-1.py
#a program to convert circumference of trees into diamaters
#
#chris haizimsque
#september 2009


print "******************************************************"
print " this program converts a mesurment of a tree's"
print " circumfrance to an estimate of its diamater"
print " (assuming the tree to be circular in cross-section ."
print " *****************************************************"
print

circumfrerence = input (' enter the circumference of the tree in centimeters: ')

diameter = circumfrance / 3.141592654

print
print "the tree's diameter is approximatley", diameter, "centemeteres."
print

done = raw_input ('press enter to exit. ')



but this is what i get back

Traceback (most recent call last):
File "C:/Python26/tree diameter.py", line 17, in <module>
diameter = circumfrance / 3.141592654
NameError: name 'circumfrance' is not defined

User is offlineProfile CardPM
+Quote Post


ankurdey25

RE: Tree Diamiter

12 Oct, 2009 - 12:20 AM
Post #2

New D.I.C Head
*

Joined: 12 Oct, 2009
Posts: 1

[color=#FF6666][b]while doing programming please concentrate on the
variable names...
while reading the data from std input device u use circumfrerence and
while calculating u r using circumfrance ... so it should be circumfrerence


QUOTE(chrishaizimsque @ 11 Oct, 2009 - 11:25 PM) *

# ncit 106 - week 3 -a3-1.py
#a program to convert circumference of trees into diamaters
#
#chris haizimsque
#september 2009


print "******************************************************"
print " this program converts a mesurment of a tree's"
print " circumfrance to an estimate of its diamater"
print " (assuming the tree to be circular in cross-section ."
print " *****************************************************"
print

circumfrerence = input (' enter the circumference of the tree in centimeters: ')

diameter = circumfrance / 3.141592654

print
print "the tree's diameter is approximatley", diameter, "centemeteres."
print

done = raw_input ('press enter to exit. ')



but this is what i get back

Traceback (most recent call last):
File "C:/Python26/tree diameter.py", line 17, in <module>
diameter = circumfrance / 3.141592654
NameError: name 'circumfrance' is not defined


User is offlineProfile CardPM
+Quote Post

chrishaizimsque

RE: Tree Diamiter

12 Oct, 2009 - 12:39 AM
Post #3

New D.I.C Head
*

Joined: 11 Oct, 2009
Posts: 5


My Contributions
i got it after a while i finaly understood what it ment at the bottem but i am still wondering how to use the repeat the task code

# ncit 106 - week 3 -a3-1.py
#a program to convert circumference of trees into diamaters
#
#chris haizimsque
#september 2009


print "******************************************************"
print " this program converts a mesurment of a tree's"
print " circumfrance to an estimate of its diamater"
print " (assuming the tree to be circular in cross-section ."
print " *****************************************************"
print

circumfrerence = input (' enter the circumference of the tree in centimeters: ')

diameter = circumfrerence / 3.141592654

print
print "the tree's diameter is approximatley", diameter, "centemeteres."
print

done = raw_input ('press enter to exit. ')


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 04:21PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month