Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 23rd, 2007, 11:40 PM   #1
blake_jl
Newbie
 
Join Date: Nov 2007
Posts: 14
Rep Power: 0 blake_jl is on a distinguished road
Question Number 1

Hi All,

I am new. I have posted in the introduction forums. You can read my post there to get to know why I am here.

As it says, I am a newbie. Teaching myself (with your help) Python. This is my first question, very basic but I'm starting right from the beginning.

I am reading through a beginners book that was linked to another thread in this forum. It got me to create the following script
def newLine():
    print
def threeLines():
    newLine()
    newLine()
    newLine()
def nineLines():
    threeLines()
    threeLines()
    threeLines()
def twentysevenLines():
    nineLines()
    nineLines()
    nineLines()
print "First Line."
twentysevenLines()
print "Second Line."

No dramas at all. It just prints the first line, then 27 blank lines and then the second line.

As an excercise the book gets me to:

"move the last three lines of this program to the top, so the function calls appear before the definitions. Run the program and see what error message you get."

This should be like this right?
print "First Line."
twentysevenLines()
print "Second Line."
def newLine():
    print
def threeLines():
    newLine()
    newLine()
    newLine()
def nineLines():
    threeLines()
    threeLines()
    threeLines()
def twentysevenLines():
    nineLines()
    nineLines()
    nineLines()

The only problem is I dont get any errors. It prints the first line, then 27 blank lines and then the second line just like the original script.

What am I missing here? Should there be an error?
blake_jl is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
c-unix-childprocesses-random number programmingnoob C 7 Feb 6th, 2007 8:39 PM
very simple question. make button change number in edit box nickm Delphi 2 Apr 29th, 2006 10:47 PM
One more question infinite! massive-war C++ 8 Apr 11th, 2005 12:11 AM
non repeating random number generation gencor45 C# 2 Feb 9th, 2005 12:11 AM
Number Systems... Ade Coder's Corner Lounge 7 Jan 19th, 2005 5:32 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:19 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC