Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old May 4th, 2008, 09:36 PM
ayeyo ayeyo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 6 ayeyo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 38 m 17 sec
Reputation Power: 0
..........

................

Reply With Quote
  #2  
Old May 4th, 2008, 09:40 PM
ryon420's Avatar
ryon420 ryon420 is offline
Oscar Wilde addict
Click here for more information
 
Join Date: Jun 2006
Location: Was lost, then found, now lost again.
Posts: 2,548 ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)ryon420 User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 1496 Folding Title: Novice Folder
Time spent in forums: 4 Months 2 Weeks 6 Days 20 h 40 m 48 sec
Reputation Power: 670
Send a message via MSN to ryon420 Send a message via Google Talk to ryon420
Google is your friend.

Is this homework?
__________________

Warning, the post above may contain extreme sarcasm, crude language, and code that may confuse amateurs and professionals.


Helpful stuff: Google your question first | Read the rules | How to ask a question
Sites: Philosophorum: "where even the trolls are smart" | How to become a coding Guru
"A bad plan is one carved in stone" -- Publilius Syrus


Reply With Quote
  #3  
Old May 4th, 2008, 09:42 PM
ayeyo ayeyo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 6 ayeyo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 38 m 17 sec
Reputation Power: 0
.................

........

Reply With Quote
  #4  
Old May 4th, 2008, 10:25 PM
c-2501 c-2501 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Location: Scotland
Posts: 28 c-2501 User rank is Corporal (100 - 500 Reputation Level)c-2501 User rank is Corporal (100 - 500 Reputation Level)c-2501 User rank is Corporal (100 - 500 Reputation Level)c-2501 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 10 h 22 m 21 sec
Reputation Power: 0
You did ask this question already here: http://forums.devshed.com/python-pr...our-524005.html

And I did give you a long and fairly complete answer there. What are you still having trouble with exactly?

Reply With Quote
  #5  
Old May 5th, 2008, 12:58 AM
Schol-R-LEA's Avatar
Schol-R-LEA Schol-R-LEA is offline
Commie Mutant Traitor
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Location: The People's Republic of Berkeley
Posts: 1,038 Schol-R-LEA User rank is Major (30000 - 40000 Reputation Level)Schol-R-LEA User rank is Major (30000 - 40000 Reputation Level)Schol-R-LEA User rank is Major (30000 - 40000 Reputation Level)Schol-R-LEA User rank is Major (30000 - 40000 Reputation Level)Schol-R-LEA User rank is Major (30000 - 40000 Reputation Level)Schol-R-LEA User rank is Major (30000 - 40000 Reputation Level)Schol-R-LEA User rank is Major (30000 - 40000 Reputation Level)Schol-R-LEA User rank is Major (30000 - 40000 Reputation Level)Schol-R-LEA User rank is Major (30000 - 40000 Reputation Level)Schol-R-LEA User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 8 h 32 m 33 sec
Reputation Power: 330
Detailed explanation of looping in Python, using both recursion and iteration. HTH.

What have you tried with this problem so far? If you can post any code you've already written, we could give you advice on how to fix it, but we really can't do much for you without seeing what you've tried so far.

Final note: if and when you poat any code, remember to use code tags to preserve indentation. This is even more important in Python that in most languages, because indentation is used in the language itself rather than just being a programming convention.
__________________
Rev First Speaker Schol-R-LEA;2 JAM LCF ELF KoR KCO BiWM TGIF
#define KINSEY (rand() % 7) λ Scheme is the Red Pill
Scheme in ShortUnderstanding the C/C++ Preprocessor
Taming PythonA Highly Opinionated Review of Programming Languages for the Novice, v1.1

FOR SALE: One ShapeSystem 2300 CMD, extensively modified for human use. Includes s/w for anthro, transgender, sex-appeal enhance, & Gillian Anderson and Jason D. Poit clone forms. Some wear. $4500 obo. tverres@et.ins.gov

Reply With Quote
  #6  
Old May 5th, 2008, 01:21 AM
sreekanth809 sreekanth809 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: melbourne
Posts: 8 sreekanth809 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 27 sec
Reputation Power: 0
Send a message via Yahoo to sreekanth809
Orkut
nxn table

Quote:
Originally Posted by ayeyo
Hi,

Whats the code in python that would allow me to make an n x n times table. The program should get n from the user.could be like this.please suggest a less complicated code clearly

| 1 2 3 4
-------------------------
1 | 1 2 3 4
2 | 2 4 6 8
3 | 3 6 9 12
4 | 4 8 12 16


thanks
12

Reply With Quote
  #7  
Old May 5th, 2008, 01:32 AM
sreekanth809 sreekanth809 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: melbourne
Posts: 8 sreekanth809 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 27 sec
Reputation Power: 0
Send a message via Yahoo to sreekanth809
Orkut
Whats the code in python that would allow me to make an n x n times table. The program should get n from the user.could be like this.please suggest a less complicated code clearly

| 1 2 3 4
-------------------------
1 | 1 2 3 4
2 | 2 4 6 8
3 | 3 6 9 12
4 | 4 8 12 16

Reply With Quote
  #8  
Old May 5th, 2008, 01:36 AM
sreekanth809 sreekanth809 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: melbourne
Posts: 8 sreekanth809 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 27 sec
Reputation Power: 0
Send a message via Yahoo to sreekanth809
Orkut
2. Write a function that given the string “original” create a new string “dramatic’ that has two consecutive copies of each letter from the original string. For example the string “argh” would appear “aarrgghh”

Reply With Quote
  #9  
Old May 5th, 2008, 01:37 AM
sreekanth809 sreekanth809 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: melbourne
Posts: 8 sreekanth809 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 27 sec
Reputation Power: 0
Send a message via Yahoo to sreekanth809
Orkut
3. Write a function, sliding(word, num)that behaves as follows. It should print out each slice of the original word having length num, aligned vertically as shown below. A call to sliding(examples, 4) would produce:
exam
xamp
ampl
ples

Reply With Quote
  #10  
Old May 5th, 2008, 01:37 AM
sreekanth809 sreekanth809 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: melbourne
Posts: 8 sreekanth809 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 27 sec
Reputation Power: 0
Send a message via Yahoo to sreekanth809
Orkut
1. Write a program that prints an n-level stair case made of text. The user should choose the text character and the number of stairs in the stair case
*
**
***
****

Reply With Quote
  #11  
Old May 5th, 2008, 01:38 AM
sreekanth809 sreekanth809 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: melbourne
Posts: 8 sreekanth809 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 27 sec
Reputation Power: 0
Send a message via Yahoo to sreekanth809
Orkut
robot

5. Write a function with a signature cheerlead(word) that prints a typical cheer as follows. The word robot:
Gimme an R
Gimme an O
Gimme a B
Gimme an O
Gimme a T
What did you give me?
ROBOT!!!

Reply With Quote
  #12  
Old May 5th, 2008, 01:38 AM
sreekanth809 sreekanth809 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: melbourne
Posts: 8 sreekanth809 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 27 sec
Reputation Power: 0
Send a message via Yahoo to sreekanth809
Orkut
Quote:
Originally Posted by sreekanth809
5. Write a function with a signature cheerlead(word) that prints a typical cheer as follows. The word robot:
Gimme an R
Gimme an O
Gimme a B
Gimme an O
Gimme a T
What did you give me?
ROBOT!!!
6. Write a program that reads a file named famous.txt and prints out the line with the longest length. In the case of a tie, you may print out only one of them. For example in the file:
Alan Turing
John von Neumann
Donald Knuth
Charles Babbage
Grace Hopper
your program should print out John von Neumann

Reply With Quote
  #13  
Old May 5th, 2008, 01:39 AM
sreekanth809 sreekanth809 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: melbourne
Posts: 8 sreekanth809 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 27 sec
Reputation Power: 0
Send a message via Yahoo to sreekanth809
Orkut
Quote:
Originally Posted by sreekanth809
6. Write a program that reads a file named famous.txt and prints out the line with the longest length. In the case of a tie, you may print out only one of them. For example in the file:
Alan Turing
John von Neumann
Donald Knuth
Charles Babbage
Grace Hopper
your program should print out John von Neumann
Write robust exception handling so the program does not crash if the file is not available.

Find and print out all occurrences of the longest line.
For example if the file held:
Alan Turing
Jonn von Neumann
Donald Knuth
Charles Babbage
Grace Hopper
Pete van de Beck
your program should print out:
John von Neumann
Pete van de Beck

Reply With Quote
  #14  
Old May 5th, 2008, 09:42 AM
c-2501 c-2501 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Location: Scotland
Posts: 28 c-2501 User rank is Corporal (100 - 500 Reputation Level)c-2501 User rank is Corporal (100 - 500 Reputation Level)c-2501 User rank is Corporal (100 - 500 Reputation Level)c-2501 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 10 h 22 m 21 sec
Reputation Power: 0
Angry

Don't make me call the mods

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > How to make an nxn table program in python


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