Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,749 members, 7,817,077 topics. Date: Saturday, 04 May 2024 at 03:34 AM

Questions A Beginner Python Programmer Have - Programming (2) - Nairaland

Nairaland Forum / Science/Technology / Programming / Questions A Beginner Python Programmer Have (2970 Views)

I Want To Hire A Beginner Who Is Willing To Learn New Skills / Any Female Python Programmer Here?? / Should A Beginner Learn 2 Programming Languages At Once? (2) (3) (4)

(1) (2) (Reply) (Go Down)

Re: Questions A Beginner Python Programmer Have by Creatrixity(m): 9:23am On Oct 20, 2013
PhenomenonVFX:

Android is the future bro.
Open source is the new religion.
If not for my laziness or unwillingness, I would have started android programming fully but I am loath to learn Java as a programming language. I was planning to use Python with SL4A before. But it was kind of quirky. So now I think I should learn Java. That will be my first target next year. And Jython will come in handy for me afterwards.

Lol @'loathe java'!.
I was in your shoes a month ago,I actually told my developer friends that java is the last language I intend on learning but Android made me reconsider my stance.
Jython is my goal as it borrows the best from both worlds namely python's extensibility with c and java's speed.
Do you use Cython?
Re: Questions A Beginner Python Programmer Have by dpuzo: 9:57am On Oct 20, 2013
Javanian:

They are really strict, they can reject your app for the silliest of reasons. I would notify every one when the app is set to launch.
Wich app?
Re: Questions A Beginner Python Programmer Have by Nobody: 11:23am On Oct 20, 2013
Creatrixity:
Lol @'loathe java'!.
I was in your shoes a month ago,I actually told my developer friends that java is the last language I intend on learning but Android made me reconsider my stance.
Jython is my goal as it borrows the best from both worlds namely python's extensibility with c and java's speed.
Do you use Cython?

Nope just pure python only. Any performance improvements I do to my code is usually algorithm improvements like rewriting some part of the code so they run in constant time instead of polynomial time. Little things like that. It keeps me on my toes.
Personally, I dream of the day Google will make Python a major programming language for Android as it is for the Google App Engine. Maybe then I may be rid of this infernal Java until the end of the universe. grin
Re: Questions A Beginner Python Programmer Have by Creatrixity(m): 12:13pm On Oct 20, 2013
PhenomenonVFX:

Nope just pure python only. Any performance improvements I do to my code is usually algorithm improvements like rewriting some part of the code so they run in constant time instead of polynomial time. Little things like that. It keeps me on my toes.
Personally, I dream of the day Google will make Python a major programming language for Android as it is for the Google App Engine. Maybe then I may be rid of this infernal Java until the end of the universe. grin
grin.Yeah,Google should have championed the use of python seeing as it was used extensively in the development of it's main product's algorithm.
Well,you could write Android apps with python using kivy but I feel it is just a wrapper or bridge between Python and Java.
Alternatively,they should have promoted Dart or Go just like windows is promoting c#.net as the choice tool for windows phone 8 apps.
Re: Questions A Beginner Python Programmer Have by kennikazi(m): 12:19pm On Oct 20, 2013
Choi...see elders tokin! shocked
@Javanian, did u create any thread dat detailed d developmemt of ur app?
Re: Questions A Beginner Python Programmer Have by Nobody: 8:00am On Oct 30, 2013
Re: Questions A Beginner Python Programmer Have by initialize(m): 12:02pm On Oct 30, 2013
Hi Elders

I'm d newest beginner in programming and I want to start with learning phyton, I av downloaded all d recommended ebooks but I don't knw which environment I will be writing to code yet.

Someone shud pls give a direct download link to a phyton environment were I will be able to practice when I start to read d books. Thanks
Re: Questions A Beginner Python Programmer Have by DAvIt0(m): 1:12pm On Oct 30, 2013
initialize: Hi Elders

I'm d newest beginner in programming and I want to start with learning phyton, I av downloaded all d recommended ebooks but I don't knw which environment I will be writing to code yet.

Someone shud pls give a direct download link to a phyton environment were I will be able to practice when I start to read d books. Thanks

Go to http://python.org and download python 3. above for your operating system (windows/linix/mac)
Re: Questions A Beginner Python Programmer Have by initialize(m): 1:49pm On Oct 30, 2013
DAvIt0:

Go to http://python.org and download python 3. above for your operating system (windows/linix/mac)

Thanks
Re: Questions A Beginner Python Programmer Have by Ajibel(m): 2:10pm On Oct 30, 2013
decode:
import turtle
t = turtle. pen ()
t.forward (67)

This is the pythonic code for it:

import turtle
t = turtle.Pen()
t.forward(67)

#write it as i did wink
Re: Questions A Beginner Python Programmer Have by Ajibel(m): 2:14pm On Oct 30, 2013
Lemme guess, you're reading SNAKE WRANGLING FOR KIDS I've read the book and that's where i learnt Turtle smiley
Re: Questions A Beginner Python Programmer Have by Ajibel(m): 2:16pm On Oct 30, 2013
DAvIt0:

Go to http://python.org and download python 3. above for your operating system (windows/linix/mac)

why python 3 embarassed
Re: Questions A Beginner Python Programmer Have by Ajibel(m): 2:26pm On Oct 30, 2013
Lets do sth interesting with our IDLE:

import turtle
t = turtle.Pen()
for x in range(1, 9):
t.forward(200)
t.left(225)

t.reset()

@decode, thanks for bringing up this. I had fun while learning turtle. Cant wait to get back home nau then launch my idle and start turtling. Pls point out if there's a mistake o embarassed cuz i havent tested the codes sad
Re: Questions A Beginner Python Programmer Have by kennikazi(m): 7:39pm On Oct 30, 2013
Ajibel: Lets do sth interesting with our IDLE:

import turtle
t = turtle.Pen()
for x in range(1, 9):
t.forward(200)
t.left(225)

t.reset()

@decode, thanks for bringing up this. I had fun while learning turtle. Cant wait to get back home nau then launch my idle and start turtling. Pls point out if there's a mistake o embarassed cuz i havent tested the codes sad
:|:|...what is turtle
Re: Questions A Beginner Python Programmer Have by bb6xt(m): 8:21pm On Oct 30, 2013
Creatrixity: 1.Instance variables are readily accessible by all objects and methods while class variables are protected.
To make a class variable visible you would have to use the global keyword.
I will think up an example and answer question 2 when i get back on my pc.
You're WRONG!
Both instance and class variables are accessible by ALL methods. Class variables are better known as static attributes, they can be accessed on the class itself rather than from instances. For example:

class Car(Object):
brand = 'Audi'
def __init__(self, color):
self.color = color

c = Car('red') # c is an instance of Car while Car is a class
print(c.brand) # Audi
print(c.color) # red
print(Car.brand) # Audi
print(Car.color) # ERROR

Python has no notion of variable hiding and as such does not have scope modifiers like private, protected, friend, public. However, one can implement such by implementing __getattr__ and __setattr__ in a class or by using composition.
The Pythonic way is to precede the name of any variable you wish to be private with an underscore, this does not hide it but anyone using the resulting api will know he is OYO when using such variables.
Variables defined in a function or method are visible only in such function or method except it is attached to self in the case of a method like self.color above.
All module level variables can equally be accessed within a class without using the global keyword but global is required when accessing them in free standing functions in the module.
My 2kobo
Re: Questions A Beginner Python Programmer Have by Ajibel(m): 8:45pm On Oct 30, 2013
kennikazi:
:|:|...what is turtle

Turtle is a python module/package bundled with python that teaches you how computers draw pictures on your computer screen. Test those codes i wrote to see what it'd give ya wink
I love turtling grin

1 Like

Re: Questions A Beginner Python Programmer Have by Nobody: 6:19pm On Nov 03, 2013
Re: Questions A Beginner Python Programmer Have by Ajibel(m): 6:27pm On Nov 03, 2013
decode:
IT DIDN'T WORK! SOMEBODY HELP!!

post the code u actually wrote. You may have made some semantics/syntax error!!
Re: Questions A Beginner Python Programmer Have by Creatrixity(m): 10:53pm On Nov 03, 2013
bb6xt:
You're WRONG!
Both instance and class variables are accessible by ALL methods. Class variables are better known as static attributes, they can be accessed on the class itself rather than from instances. For example:

class Car(Object):
brand = 'Audi'
def __init__(self, color):
self.color = color

c = Car('red') # c is an instance of Car while Car is a class
print(c.brand) # Audi
print(c.color) # red
print(Car.brand) # Audi
print(Car.color) # ERROR

Python has no notion of variable hiding and as such does not have scope modifiers like private, protected, friend, public. However, one can implement such by implementing __getattr__ and __setattr__ in a class or by using composition.
The Pythonic way is to precede the name of any variable you wish to be private with an underscore, this does not hide it but anyone using the resulting api will know he is OYO when using such variables.
Variables defined in a function or method are visible only in such function or method except it is attached to self in the case of a method like self.color above.
All module level variables can equally be accessed within a class without using the global keyword but global is required when accessing them in free standing functions in the module.
My 2kobo
Thanks for the correction.
Its been ages I wrote python
grin grin grin grin
Re: Questions A Beginner Python Programmer Have by Nobody: 8:11pm On Nov 08, 2013
Re: Questions A Beginner Python Programmer Have by Ajibel(m): 7:05pm On Nov 11, 2013
decode:
That's exactly how I wrote it.

Hmm sad I .gif up angry
Erm, which tutorial did u find dis in, lemme check it out :-/

(1) (2) (Reply)

Gradle Problem In Android Studio / Learn How To Build A Realtime Chat Application With Django, Rabbitmq And Vue.js / What Really Can I Do In The Dark Web With The Aid Of Tor Brwser?

(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. 38
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.