Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #110227 > unrolled thread

Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

Started byPushpanth Gundepalli <pushpanth2000@gmail.com>
First post2016-06-21 04:03 -0700
Last post2016-06-28 19:04 -0700
Articles 17 — 11 participants

Back to article view | Back to comp.lang.python


Contents

  Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. Pushpanth Gundepalli <pushpanth2000@gmail.com> - 2016-06-21 04:03 -0700
    Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. Rick Johnson <rantingrickjohnson@gmail.com> - 2016-06-21 10:14 -0700
    Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. jfong@ms4.hinet.net - 2016-06-21 18:36 -0700
    Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. Miki Tebeka <miki.tebeka@gmail.com> - 2016-06-22 01:38 -0700
      Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. Nick Sarbicki <nick.a.sarbicki@gmail.com> - 2016-06-22 08:45 +0000
      Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. John Wong <gokoproject@gmail.com> - 2016-06-22 04:51 -0400
    Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. Pushpanth Gundepalli <pushpanth2000@gmail.com> - 2016-06-22 22:35 -0700
      Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. DFS <nospam@dfs.com> - 2016-06-23 02:36 -0400
        Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. Cousin Stanley <HooDunnit@didly42KahZidly.net> - 2016-06-23 08:11 -0700
          Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. DFS <nospam@dfs.com> - 2016-06-23 12:22 -0400
            Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. Cousin Stanley <HooDunnit@didly42KahZidly.net> - 2016-06-23 09:39 -0700
              Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. DFS <nospam@dfs.com> - 2016-06-23 13:03 -0400
        Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. DFS <nospam@dfs.com> - 2016-06-23 12:22 -0400
      RE: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. Joe Gulizia <jrgulizia@scola.org> - 2016-06-23 10:28 +0000
      Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. DFS <nospam@dfs.com> - 2016-06-23 12:24 -0400
    Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. Sayth Renshaw <flebber.crue@gmail.com> - 2016-06-23 18:41 -0700
    Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. Umar Yusuf <bintacomputers@gmail.com> - 2016-06-28 19:04 -0700

#110227 — Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

FromPushpanth Gundepalli <pushpanth2000@gmail.com>
Date2016-06-21 04:03 -0700
SubjectGuys, can you please share me some sites where we can practice python programs for beginners and Intermediate.
Message-ID<7d5d9d8a-9c85-433a-b91a-6af3a36fd7ee@googlegroups.com>
Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

[toc] | [next] | [standalone]


#110248

FromRick Johnson <rantingrickjohnson@gmail.com>
Date2016-06-21 10:14 -0700
Message-ID<9411cdf9-4a55-45ec-89e6-dfa22c7ed9c9@googlegroups.com>
In reply to#110227
On Tuesday, June 21, 2016 at 6:03:28 AM UTC-5, Pushpanth Gundepalli wrote:
> Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

Have you tried googling for "python interactive tutorial"? Someone had created one similar to Ruby's, but i cannot remember the site. The python.org website has an interactive shell you can play around with online, but it's no different than using Python on your machine -- not much advantage anyway.

[toc] | [prev] | [next] | [standalone]


#110277

Fromjfong@ms4.hinet.net
Date2016-06-21 18:36 -0700
Message-ID<cdf2dc9c-677b-4ae8-97e7-977d3fffe96b@googlegroups.com>
In reply to#110227
Pushpanth Gundepalli at 2016/6/21 7:03:28PM wrote:
> Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

Is this you want? http://pythontutor.com/

--Jach

[toc] | [prev] | [next] | [standalone]


#110305

FromMiki Tebeka <miki.tebeka@gmail.com>
Date2016-06-22 01:38 -0700
Message-ID<bc9f9d7d-eff3-488f-b75a-3dc762ac814c@googlegroups.com>
In reply to#110227
On Tuesday, June 21, 2016 at 2:03:28 PM UTC+3, Pushpanth Gundepalli wrote:
> Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

IMO you can do that at https://www.codecademy.com/learn/python

[toc] | [prev] | [next] | [standalone]


#110306

FromNick Sarbicki <nick.a.sarbicki@gmail.com>
Date2016-06-22 08:45 +0000
Message-ID<mailman.30.1466585146.11516.python-list@python.org>
In reply to#110305
On Wed, Jun 22, 2016 at 9:42 AM Miki Tebeka <miki.tebeka@gmail.com> wrote:

> IMO you can do that at https://www.codecademy.com/learn/python
>

Some people might think differently but I wouldn't recommend a python
course which teaches 2.7 over 3.x.

It bugs me that learnpythonthehardway and codecademy - probably 2 of the
biggest platforms for learning python at the moment - both refuse to move
to python 3.

[toc] | [prev] | [next] | [standalone]


#110307

FromJohn Wong <gokoproject@gmail.com>
Date2016-06-22 04:51 -0400
Message-ID<mailman.31.1466585487.11516.python-list@python.org>
In reply to#110305
On Wed, Jun 22, 2016 at 4:45 AM, Nick Sarbicki <nick.a.sarbicki@gmail.com>
wrote:

> On Wed, Jun 22, 2016 at 9:42 AM Miki Tebeka <miki.tebeka@gmail.com> wrote:
>
> > IMO you can do that at https://www.codecademy.com/learn/python
> >
>
> Some people might think differently but I wouldn't recommend a python
> course which teaches 2.7 over 3.x.
>
>
pythontutor does support Python 3. Haven't tried CA for a while.

[toc] | [prev] | [next] | [standalone]


#110369

FromPushpanth Gundepalli <pushpanth2000@gmail.com>
Date2016-06-22 22:35 -0700
Message-ID<4d2803c0-9bc9-4ae5-b5dd-96bb113b7ba1@googlegroups.com>
In reply to#110227
On Tuesday, June 21, 2016 at 4:33:28 PM UTC+5:30, Pushpanth Gundepalli wrote:
> Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

Thank you for ur valuable suggestions.. Actually i have done practising the exercises on codeacademy, codingbat. But the thing is that i want to do a live project which wil help me to enchance my skills more.. I'm happy tht I'm able to understand and write small lines of code(i think it is a small achivement for me and it boost my confidence).. but i need to improve more on programming.. Also pls help me out on how I can get some real time projects to practice!!

[toc] | [prev] | [next] | [standalone]


#110371

FromDFS <nospam@dfs.com>
Date2016-06-23 02:36 -0400
Message-ID<nkg00g$lgt$1@dont-email.me>
In reply to#110369
On 6/23/2016 1:35 AM, Pushpanth Gundepalli wrote:
> On Tuesday, June 21, 2016 at 4:33:28 PM UTC+5:30, Pushpanth
> Gundepalli wrote:
>> Guys, can you please share me some sites where we can practice
>> python programs for beginners and Intermediate.
>
> Thank you for ur valuable suggestions.. Actually i have done
> practising the exercises on codeacademy, codingbat. But the thing is
> that i want to do a live project which wil help me to enchance my
> skills more.. I'm happy tht I'm able to understand and write small
> lines of code(i think it is a small achivement for me and it boost my
> confidence).. but i need to improve more on programming.. Also pls
> help me out on how I can get some real time projects to practice!!



Here's a fun one: scraping data off a website, and storing it in a 
SQLite database file.

First you need to install the requests and lxml packages.

-----------------------------------------------------------------
import requests, sqlite3
from lxml import html

dbName = "TECHTERMS.sqlite"
conn   = sqlite3.connect(dbName)
db     = conn.cursor()
db.execute("CREATE TABLE If Not Exists TECHTERMS (Term,Category, PRIMARY 
KEY (Term));")

techterms = 'http://techterms.com/techfactor/4'
page = requests.get(techterms)
tree = html.fromstring(page.content)
terms    = tree.xpath('//a[@href]/text()')
category = tree.xpath('//td/text()')

print terms; print
print category; print

dropwords = ['Advanced Search', 'Browse', 'Quizzes', 'Help', 'Home', 
'Browse', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'Terms of 
Use', 'Privacy Policy', 'About', 'Contact']
terms = [x for x in terms if x not in dropwords]

p = []	
if len(terms) == len(category):
	for i in range(0,len(terms)):
		p.append((terms[i],category[i]))

for term, category in p:
	print "%s, %s" % (term, category)
	db.execute("INSERT OR IGNORE INTO TECHTERMS VALUES (?,?)",(term,category))
conn.commit()

db.close()
conn.close()
print "Finished"
-----------------------------------------------------------------

[toc] | [prev] | [next] | [standalone]


#110422

FromCousin Stanley <HooDunnit@didly42KahZidly.net>
Date2016-06-23 08:11 -0700
Message-ID<nkgu7e$nj6$1@dont-email.me>
In reply to#110371
DFS wrote:

> Here's a fun one: scraping data off a website, 
> and storing it in a SQLite database file.
> ....

  After testing your example code here I found 
  that the length of the  categories  list
  was 1 less than the  terms  list after applying
  dropwords in the  terms  list comprehension .... 

  The subsequent len comparison then failed
  and no data was inserted into the data base .... 

  As a fix I added an extra category ....

    category.append( 'didly' )
  
  Subsequently, data was inserted
  with a single extra category 
  for the  last  term in terms .... 
  

  Thanks for posting the example code ....


-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona

[toc] | [prev] | [next] | [standalone]


#110425

FromDFS <nospam@dfs.com>
Date2016-06-23 12:22 -0400
Message-ID<nkh2c2$715$2@dont-email.me>
In reply to#110422
On 6/23/2016 11:11 AM, Cousin Stanley wrote:
> DFS wrote:
>
>> Here's a fun one: scraping data off a website,
>> and storing it in a SQLite database file.
>> ....
>
>   After testing your example code here I found
>   that the length of the  categories  list
>   was 1 less than the  terms  list after applying
>   dropwords in the  terms  list comprehension ....
>
>   The subsequent len comparison then failed
>   and no data was inserted into the data base ....
>
>   As a fix I added an extra category ....
>
>     category.append( 'didly' )
>
>   Subsequently, data was inserted
>   with a single extra category
>   for the  last  term in terms ....


Strange!  After dropwords, the list lengths match for me (both are 152).

So in your table, is 'didly' now the category for the last term 
'Rendering'?  Mine is 'Technical', as it is on the source webpage.

I usually put list length tests in place, not sure what happened here.




>   Thanks for posting the example code ....

Sure thing.

[toc] | [prev] | [next] | [standalone]


#110429

FromCousin Stanley <HooDunnit@didly42KahZidly.net>
Date2016-06-23 09:39 -0700
Message-ID<nkh3cm$b48$1@dont-email.me>
In reply to#110425
DFS wrote:

> On 6/23/2016 11:11 AM, Cousin Stanley wrote:
>> DFS wrote:
>>
>>> Here's a fun one: scraping data off a website,
>>> and storing it in a SQLite database file.
>>> ....
>>
>>   After testing your example code here I found
>>   that the length of the  categories  list
>>   was 1 less than the  terms  list after applying
>>   dropwords in the  terms  list comprehension ....
>>
>>   The subsequent len comparison then failed
>>   and no data was inserted into the data base ....
>>
>>   As a fix I added an extra category ....
>>
>>     category.append( 'didly' )
>>
>>   Subsequently, data was inserted
>>   with a single extra category
>>   for the  last  term in terms ....
> 
> 
> Strange!  After dropwords, the list lengths match 
> for me (both are 152).
> 

  Found 153 for terms and 152 for categories,
  so I appended 1 to categories ...

> So in your table, is 'didly' now the category for the last term

> 'Rendering'?  Mine is 'Technical', as it is on the source webpage.

  Last 5 printed from the final loop 
  just before the db insert .... 

    ....
    Passphrase , Technical
    Passcode , Technical
    Touchpad , Hardware
    Rendering , Technical
    Terms of Use , didly

> 
> I usually put list length tests in place, 
> not sure what happened here.

  Possibly a copy/paste difference
  on my end ....
 

-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona

[toc] | [prev] | [next] | [standalone]


#110432

FromDFS <nospam@dfs.com>
Date2016-06-23 13:03 -0400
Message-ID<nkh4ob$fg7$3@dont-email.me>
In reply to#110429
On 6/23/2016 12:39 PM, Cousin Stanley wrote:

> Terms of Use , didly
>
> Possibly a copy/paste difference on my end ....


'Terms of Use' isn't being removed like it should.  When I pasted the 
code into Thunderbird, it put a line break after 'Terms of'.  Fix that 
and the code will run fine.

But it still needs minor tweaks:

* should have a list length test in it
* the last for loop should be indented under the last if statement

Regardless, hope you learned something from it.


The biggest pain when writing it was probably figuring out how to 
extract data from the HTML:

terms    = tree.xpath('//a[@href]/text()')
category = tree.xpath('//td/text()')


[toc] | [prev] | [next] | [standalone]


#110426

FromDFS <nospam@dfs.com>
Date2016-06-23 12:22 -0400
Message-ID<nkh2d0$715$3@dont-email.me>
In reply to#110371
On 6/23/2016 2:36 AM, DFS wrote:
> On 6/23/2016 1:35 AM, Pushpanth Gundepalli wrote:
>> On Tuesday, June 21, 2016 at 4:33:28 PM UTC+5:30, Pushpanth
>> Gundepalli wrote:
>>> Guys, can you please share me some sites where we can practice
>>> python programs for beginners and Intermediate.
>>
>> Thank you for ur valuable suggestions.. Actually i have done
>> practising the exercises on codeacademy, codingbat. But the thing is
>> that i want to do a live project which wil help me to enchance my
>> skills more.. I'm happy tht I'm able to understand and write small
>> lines of code(i think it is a small achivement for me and it boost my
>> confidence).. but i need to improve more on programming.. Also pls
>> help me out on how I can get some real time projects to practice!!
>
>
>
> Here's a fun one: scraping data off a website, and storing it in a
> SQLite database file.

For additional learning/practice, figure out how to adopt the code to 
loop thru all the webpages (there are 10).

http://techterms.com/techfactor/1
http://techterms.com/techfactor/2
http://techterms.com/techfactor/3
http://techterms.com/techfactor/4
http://techterms.com/techfactor/5
http://techterms.com/techfactor/6
http://techterms.com/techfactor/7
http://techterms.com/techfactor/8
http://techterms.com/techfactor/9
http://techterms.com/techfactor/10

Hint:

for i in range(1,11):
	techterms = 'http://techterms.com/techfactor/' + str(i)


Note: when I first coded it, I ran it too fast (no sleep() between 
loops), and after a few times the site responded with something like:

Browse site
Contact webmaster

and wouldn't return any data.

So in your programming, you probably want to put a 2-second break before 
going to the next page:

import time
time.sleep(2)


[toc] | [prev] | [next] | [standalone]


#110402

FromJoe Gulizia <jrgulizia@scola.org>
Date2016-06-23 10:28 +0000
Message-ID<mailman.66.1466677737.11516.python-list@python.org>
In reply to#110369
________________________________________
From: Python-list <python-list-bounces+jrgulizia=scola.org@python.org> on behalf of Pushpanth Gundepalli <pushpanth2000@gmail.com>
Sent: Thursday, June 23, 2016 12:35 AM
To: python-list@python.org
Subject: Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

On Tuesday, June 21, 2016 at 4:33:28 PM UTC+5:30, Pushpanth Gundepalli wrote:
> Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

Thank you for ur valuable suggestions.. Actually i have done practising the exercises on codeacademy, codingbat. But the thing is that i want to do a live project which wil help me to enchance my skills more.. I'm happy tht I'm able to understand and write small lines of code(i think it is a small achivement for me and it boost my confidence).. but i need to improve more on programming.. Also pls help me out on how I can get some real time projects to practice!!
--
https://mail.python.org/mailman/listinfo/python-list







Computer Science Circles - University of Waterloo

http://cscircles.cemc.uwaterloo.ca

Almost any open source project welcomes volunteers....I'd start with FSF.org (Free Software Foundation) or EFSF (European FSF) https://fsfe.org/

Joe

[toc] | [prev] | [next] | [standalone]


#110428

FromDFS <nospam@dfs.com>
Date2016-06-23 12:24 -0400
Message-ID<nkh2fa$715$4@dont-email.me>
In reply to#110369
On 6/23/2016 1:35 AM, Pushpanth Gundepalli wrote:
> On Tuesday, June 21, 2016 at 4:33:28 PM UTC+5:30, Pushpanth Gundepalli wrote:
>> Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.
>
> Thank you for ur valuable suggestions.. Actually i have done practising the exercises on codeacademy, codingbat. But the thing is that i want to do a live project which wil help me to enchance my skills more.. I'm happy tht I'm able to understand and write small lines of code(i think it is a small achivement for me and it boost my confidence).. but i need to improve more on programming.. Also pls help me out on how I can get some real time projects to practice!!


Here's another interesting one: count the number of posts made by nyms 
on a Usenet group.  usage (Windows) is python filename.py last N


import sys as y,nntplib as t
s='news.eternal-september.org'
g='comp.lang.python'
n=t.NNTP(s,119,'<usr>','<pw>')
r,a,b,e,gn=n.group(g)
r,d=n.xhdr('From','%s-%s'%(int(e)-int(y.argv[2])+1,int(e)))
p=[]
for i in range(len(d)):p.append(d[i][1])
x=[(i,p.count(i)) for i in set(p)]
x.sort(key=lambda s:(-s[1],s[0].lower()))
print('Posts  %s %s'%(len(set(p)),'Posters'))
print('-----  ---------------------------------------------')
for v in x: print(' %s     %s'%(v[1],v[0]))
print('----------------------------------------------------')
n.quit()


As you can see I've shortened and 'obfuscated' it by using tiny variable 
names - so it's more fun for you to figure out.

Start at:  https://docs.python.org/2/library/nntplib.html

[toc] | [prev] | [next] | [standalone]


#110471

FromSayth Renshaw <flebber.crue@gmail.com>
Date2016-06-23 18:41 -0700
Message-ID<2beab3fc-0169-4b4d-8e1b-f17d7a22dbc0@googlegroups.com>
In reply to#110227
On Tuesday, 21 June 2016 21:03:28 UTC+10, Pushpanth Gundepalli  wrote:
> Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

Here are some good beginner projects https://knightlab.northwestern.edu/2014/06/05/five-mini-programming-projects-for-the-python-beginner/

Also a community on reddit and github are trying to acheive this.

https://learnprogramming.github.io/

https://github.com/LearnProgramming

Sayth

[toc] | [prev] | [next] | [standalone]


#110740

FromUmar Yusuf <bintacomputers@gmail.com>
Date2016-06-28 19:04 -0700
Message-ID<89f87d4c-38aa-4a27-9fcd-3916ee59febb@googlegroups.com>
In reply to#110227
Websites to learn python programming?  Try these links:-

http://umar-yusuf.blogspot.com.ng/2016/03/70-free-python-programming-language.html

http://www.sololearn.com/Course/Python/

http://www.afterhoursprogramming.com/tutorial/Python/Overview/

http://www.pyschools.com/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web