r/learningpython • • Dec 09 '20

About lists, statement, instances and objects

first_lista = [ ]

first_lista.extend('123')

print(first_lista)

First I create a object, a empty list. In the second, I used the method .extend. Last, I used the variable first_lista as an assingmente to the statement print. It's that correct?

class Simple: 
	def s(self):
		count = 0 
		n = 1 
		while count  < 10 :
			print("Count is not 10")    
		count = n + 1 


s.self()

Here, I create a method inside the class which is called s.self. E o self refers to an instance of my class. It's this correct?

Dec 12 '20
0 python3
0 python
1 Upvotes

Duplicates

anime • • Jul 10 '09

Is there a good medieval themed anime?

15 Upvotes

hockey • • Sep 21 '09

All right /r/hockey, Stanley Cup picks for this season? Nobody got it right last season!

17 Upvotes

houston • • Jan 14 '10

Houston Meet-Up on 02/06 at the Late Night Pie. All are welcome to come.

15 Upvotes

feminisms • • Aug 20 '09

Question; Feminism allows the reconstruction of what it means to be a woman. If masculinity were to be redrafted in the same way, what roles and perceptions would you include, and would you leave out?

6 Upvotes

london • • Apr 11 '10

Where can I get the best Pizza in London?

12 Upvotes

pittsburgh • • Jan 14 '10

This meetup is awesome

12 Upvotes

reddit.com • • Jun 08 '08

Ask reddit: what's your most memorable quote?

2 Upvotes

shittyadvice • • Dec 11 '09

How do I ask my neighbor to turn off his car stereo at 3AM?

6 Upvotes

listentothis • • Oct 19 '09

So why is it posts in this reddit are getting downvoted? I know there are ways around the lack of a downvote arrow, but its not being there means something- don't downvote posts. This reddit is for sharing music you like; if you don't like what other people like, then don't listen to the posts.

39 Upvotes

RecommendMe • • Jul 10 '09

Recommend me a nonfiction book that reads like narrative fiction.

4 Upvotes

electronic_cigarette • • Feb 05 '10

Any recommendations on E-cigs that you don't have to replace every 2 or 3 months? NSFW

7 Upvotes

writing • • Sep 16 '09

Hey Reddit Writers: How long are you able to write each day? I max out at three hours.

3 Upvotes

fantasyfootball • • Sep 16 '09

Gage, A Bryant, or P Harvin...who to start in week 2?

3 Upvotes

nostalgia • • Dec 06 '09

Everyone come in here and pretend it's 1999.

4 Upvotes

wave • • Dec 23 '09

Wave needs a bridge between it and Gmail which is seamless. Until then, it will not be a success.

53 Upvotes

politics • • Oct 09 '09

If you're ripping into Obama's Nobel Prize, then you DESERVE mockery. This should be a PROUD moment for America, regardless of who exactly got it.

0 Upvotes

drunk • • Aug 01 '09

I'm the asshole drinking stoli and sunbathing on the roof in bright red underwear. The universe is mine, bitches

7 Upvotes

Libertarian • • Jul 13 '10

Out of curiosity, How many of you have heard of a cure for cancer and possibly have seen it work in your personal life?

2 Upvotes

circlejerk • • Nov 25 '09

FOR EVERY UPMOD THIS GETS I WILL DONATE MONEY TO CHARITY

44 Upvotes

AskReddit • • Sep 04 '10

Do some guys just not grow chest hair? How many of you shave your chest?

0 Upvotes

chicago • • Jan 16 '10

Right now at Mullens on Clark, MiguelSTG and I have two open barstools if anyone wants to watch the Colts game with us.

5 Upvotes

ScienceQnA • • Mar 08 '10

Can anyone explain how the recent seismic activity is normal? Or should we expect more than just Haiti, Chile, Turkey...

2 Upvotes

ideasfortheadmins • • Apr 16 '10

Allow us to force tags into post titles, or give instructions on submit page.

2 Upvotes

politics • • Sep 28 '08

Ask Reddit: How do you feel about the Barack Obama "Truth Squad"? Vote in the comment section.

0 Upvotes

computing • • Jan 26 '10

Reddit: Do you have a laptop recommendation?

5 Upvotes