Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,208,213 members, 8,001,920 topics. Date: Wednesday, 13 November 2024 at 07:08 PM

Please Am Stuck Here. (python Tutorial) - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Please Am Stuck Here. (python Tutorial) (1293 Views)

My First Python Tutorial Has Been Released. / I Am Stuck With This Problem (JAVA EE) / Python Tutorial (2) (3) (4)

(1) (Reply) (Go Down)

Please Am Stuck Here. (python Tutorial) by furthest(m): 4:18pm On Aug 01, 2016
In many cases we will use a feature of program execution in Idle: that after program execution is completed, the Idle
Shell still remembers functions defined in the program. This is not true if you run a program by selecting it directly in
the operating system.
Look at the example program birthday3.py. See it just adds two more lines, not indented. Can you guess what it
does? Try it:
1 ’’’Function definition and invocation.’’’
2
3 def happyBirthdayEmily():
4 print("Happy Birthday to you!"wink
5 print("Happy Birthday to you!"wink
6 print("Happy Birthday, dear Emily."wink
7 print("Happy Birthday to you!"wink
8
9 happyBirthdayEmily()
10 happyBirthdayEmily()

1 Like

Re: Please Am Stuck Here. (python Tutorial) by Nobody: 5:10pm On Aug 01, 2016
Use PyCharm for learning and not that default shell
Re: Please Am Stuck Here. (python Tutorial) by furthest(m): 9:21pm On Aug 01, 2016
please just tell me what's wrong...i love the shell am using
Re: Please Am Stuck Here. (python Tutorial) by zzzzy: 12:21am On Aug 02, 2016
I don't really understand the problem. That program ran perfectly.
Re: Please Am Stuck Here. (python Tutorial) by furthest(m): 1:20pm On Aug 02, 2016
zzzzy:
I don't really understand the problem. That program ran perfectly.
yeah i know, i just need an explanation.
Re: Please Am Stuck Here. (python Tutorial) by Nobody: 2:38pm On Aug 02, 2016
furthest:
yeah i know, i just need an explanation.

i just tried it in python 2.7 (using the IDLE) and it worked just fine! So whats the problema?
Re: Please Am Stuck Here. (python Tutorial) by Xionglu(m): 3:49pm On Aug 02, 2016
furthest:
In many cases we will use a feature of program execution in Idle: that after program execution is completed, the Idle
Shell still remembers functions defined in the program. This is not true if you run a program by selecting it directly in
the operating system.
Look at the example program birthday3.py. See it just adds two more lines, not indented. Can you guess what it
does? Try it:
1 ’’’Function definition and invocation.’’’
2
3 def happyBirthdayEmily():
4 print("Happy Birthday to you!"wink
5 print("Happy Birthday to you!"wink
6 print("Happy Birthday, dear Emily."wink
7 print("Happy Birthday to you!"wink
8
9 happyBirthdayEmily()
10 happyBirthdayEmily()


When you write scripts on shell, it is not auto indented but u can indent it by using the tab key....shell not remembering the function declared, I doubt that.....i use the shell a lot on Kali Linux for testing some code before rewriting it in my editor...

As someone said earlier, use an editor rather than shell if u are a newbie.....Python is cool
To add, you don't get the real power of python in windows, go dirty like a friend said to me,that is use Linux...python comes preinstalled with it and some other libraries. Real programmers don't use windows, switch your style up bro.....see u @ d top

(1) (Reply)

How To Increase Google Adsense CPC: Cost Per Click For Youtube And Website 2016 / Affordable Peer To Peer Donation Script / Programmer/developer

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.