Re: [Tutor] Doubt

2019-02-26 Thread Mats Wichmann
On 2/26/19 11:36 AM, Maninath sahoo wrote: is it possible reverse inheritance? mean child class to parent class Well, it's Python, so you can do all sorts of things, some of them good ideas, some bad... Like Alan says, the question as asked doesn't really make a lot of sense to us, but the

Re: [Tutor] Doubt

2019-02-26 Thread Alan Gauld via Tutor
On 26/02/2019 18:36, Maninath sahoo wrote: > is it possible reverse inheritance? > mean child class to parent class I have no idea what you mean by that. How would it work? Can you give an example of the kind of thing you want to do? For example Circles and Rectangles are kinds of Shape so their

[Tutor] Doubt

2019-02-26 Thread Maninath sahoo
is it possible reverse inheritance? mean child class to parent class ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Doubt in Python

2019-01-16 Thread Alan Gauld via Tutor
On 16/01/2019 18:26, Maninath sahoo wrote: > Using of relational operator i Python? > How to use relational operator in List. > Please answer me.. Relational operators are more commonly called comparisons (or predicates). You use them with a List much as you use any other object. if list1 == list

[Tutor] Doubt in Python

2019-01-16 Thread Maninath sahoo
Using of relational operator i Python? How to use relational operator in List. Please answer me.. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Doubt

2019-01-08 Thread Abdur-Rahmaan Janhangeer
it's because of how the language works. c is a compiled lang. py an interpreted one ( more of a hybrid i would say ) if you write a language in c like if a == 5: do this then run your c program to execute it, you get pretty much what python is Abdur-Rahmaan Janhangeer http://www.pythonmembers.c

Re: [Tutor] Doubt

2019-01-07 Thread Steven D'Aprano
On Mon, Jan 07, 2019 at 09:59:31PM +0530, Amit Yadav wrote: > How can simply typing > > print "hello world" > > work? > Like without including any header file or import statements how can it work. Why shouldn't it work? Python is not C and doesn't use header files. In Python, the interpreter k

Re: [Tutor] Doubt

2019-01-07 Thread Peter Otten
Amit Yadav wrote: > How can simply typing > > print "hello world" > > work? > Like without including any header file or import statements how can it > work. In Python 2 print is part of the syntax that the compiler knows, just like int or for (... ) {} in C. In Python 3 print is just a na

Re: [Tutor] Doubt

2019-01-07 Thread Mats Wichmann
On 1/7/19 9:29 AM, Amit Yadav wrote: > How can simply typing > > print "hello world" > > work? > Like without including any header file or import statements how can it work. because you're using a function (or in your case - which looks like Python 2.x because it is not written as a function ca

[Tutor] Doubt

2019-01-07 Thread Amit Yadav
How can simply typing print "hello world" work? Like without including any header file or import statements how can it work.

Re: [Tutor] Doubt in list comprehension

2018-02-23 Thread vinod bhaskaran
Thanks Peter. Shall figure it out with the below hint. I had a hunch am wrong but was not sure where to put in . Thanks, Vinod Bhaskaran On Fri, Feb 23, 2018, 7:11 PM Peter Otten <__pete...@web.de> wrote: > vinod bhaskaran wrote: > > > Hi All, > > > > I am a beginner programmer and i wrote a sm

Re: [Tutor] Doubt in list comprehension

2018-02-23 Thread Mats Wichmann
On 02/23/2018 06:40 AM, Peter Otten wrote: > vinod bhaskaran wrote: > >> Hi All, >> >> I am a beginner programmer and i wrote a small program (as per a >> assignment i saw) as below: >> >> newlist = [] >> for a in range(2,5): >> for b in range (0,3): >> newlist.append([a]) >> a = a + 1 >

Re: [Tutor] Doubt in list comprehension

2018-02-23 Thread Peter Otten
vinod bhaskaran wrote: > Hi All, > > I am a beginner programmer and i wrote a small program (as per a > assignment i saw) as below: > > newlist = [] > for a in range(2,5): > for b in range (0,3): > newlist.append([a]) > a = a + 1 > print(newlist) > > it gives the expected output as be

[Tutor] Doubt in list comprehension

2018-02-23 Thread vinod bhaskaran
Hi All, I am a beginner programmer and i wrote a small program (as per a assignment i saw) as below: newlist = [] for a in range(2,5): for b in range (0,3): newlist.append([a]) a = a + 1 print(newlist) it gives the expected output as below: [[2], [3], [4], [3], [4], [5], [4], [5], [6]]

Re: [Tutor] doubt in a program

2018-01-29 Thread Jan Erik Moström
On 29 Jan 2018, at 7:42, vinod bhaskaran wrote: As the new character is adding the char in the new string but how is it getting reversed without any line giving the char number to be traversed in reverse order. You don't need that, think about this example newstring = '' oldstring = "Newton

Re: [Tutor] doubt in a program

2018-01-29 Thread vinod bhaskaran
Thanks a lot Nitin. I misunderstood the "char + newstring". As a newbie to programming as well as newbie to Python trying to grasp basics. Sure will need the built in functions present for different things in Python. Any suggestion good book for python? Thanks, Vinod Bhaskaran On Mon, Jan 29, 201

Re: [Tutor] doubt in a program

2018-01-29 Thread Nitin Madhok
Vinod, First time it loops, newstring = ‘’ oldstring = ‘Newton’ char = ‘N’ char + newstring = ‘N’ + ‘’ = ‘N’ Second time it loops, newstring = ‘N’ oldstring = ‘Newton’ char = ‘e’ char + newstring = ‘e’ +’N’ = ‘eN’ Third time it loops, newstring = ‘eN’ oldstring = ‘Newton’ char = ‘w’ char + news

Re: [Tutor] doubt in a program

2018-01-29 Thread Alan Gauld via Tutor
On 29/01/18 06:42, vinod bhaskaran wrote: > newstring = '' > oldstring = 'Newton' > for char in oldstring: >newstring = char + newstring > print(newstring) > > Could someone explain how it is traversing to get the string reversed? print statements are your friend. Add print statements everyw

[Tutor] doubt in a program

2018-01-29 Thread vinod bhaskaran
Hi, I am a new beginner in programming. I saw a code (given below) to reverse string. newstring = '' oldstring = 'Newton' for char in oldstring: newstring = char + newstring print(newstring) Could someone explain how it is traversing to get the string reversed? As the new character is add

Re: [Tutor] Doubt in for loop

2013-04-04 Thread bessenkphilip
On 04/04/2013 08:23 AM, Dave Angel wrote: On 04/03/2013 09:53 PM, Steven D'Aprano wrote: On 04/04/13 12:29, bessenkphilip wrote: Hi all, I'm having a doubt in the below program's 2n'd "for" loop. for n in range(2, 10): ... for x in range(2, n): ... if n % x == 0: ...

Re: [Tutor] Doubt in for loop

2013-04-03 Thread antipode0
I believe Dave answered the OP's intended question. On Apr 3, 2013 9:54 PM, "Dave Angel" wrote: > On 04/03/2013 09:53 PM, Steven D'Aprano wrote: > >> On 04/04/13 12:29, bessenkphilip wrote: >> >>> Hi all, >>> >>> I'm having a doubt in the below program's 2n'd "for" loop. >>> >>> for n in range(2

Re: [Tutor] Doubt in for loop

2013-04-03 Thread Dave Angel
On 04/03/2013 09:53 PM, Steven D'Aprano wrote: On 04/04/13 12:29, bessenkphilip wrote: Hi all, I'm having a doubt in the below program's 2n'd "for" loop. for n in range(2, 10): ... for x in range(2, n): ... if n % x == 0: ... print n, 'equals', x, '*', n/x ...

Re: [Tutor] Doubt in for loop

2013-04-03 Thread Steven D'Aprano
On 04/04/13 12:29, bessenkphilip wrote: Hi all, I'm having a doubt in the below program's 2n'd "for" loop. for n in range(2, 10): ... for x in range(2, n): ... if n % x == 0: ... print n, 'equals', x, '*', n/x ... break ... else: ... # loop fell

[Tutor] Doubt in for loop

2013-04-03 Thread bessenkphilip
Hi all, I'm having a doubt in the below program's 2n'd "for" loop. >>> for n in range(2, 10): ... for x in range(2, n): ... if n % x == 0: ... print n, 'equals', x, '*', n/x ... break ... else: ... # loop fell through without finding a factor ...

Re: [Tutor] Doubt!

2012-10-23 Thread emile
On 10/23/2012 04:14 PM, Nitin Ainani wrote: Dear Sir/Madam, I am new to python I have a question. It is as follows: Suppose *s* is a variable and *s* stores empty string s="" Now if we write following statement print(s[0]) # it gives error print(s[0:])# it does not give error wh

Re: [Tutor] Doubt!

2012-10-23 Thread Steven D'Aprano
On 24/10/12 10:14, Nitin Ainani wrote: Dear Sir/Madam, I am new to python I have a question. It is as follows: Suppose *s* is a variable and *s* stores empty string s="" Now if we write following statement print(s[0]) # it gives error print(s[0:])# it does not give error why?

Re: [Tutor] Doubt!

2012-10-23 Thread Dave Angel
On 10/23/2012 07:14 PM, Nitin Ainani wrote: > Dear Sir/Madam, > > I am new to python I have a question. It is as follows: > > Suppose *s* is a variable and *s* stores empty string > > s="" > Now if we write following statement > > > print(s[0]) # it gives error There is no 0th character, so

Re: [Tutor] doubt in Regular expressions

2006-06-26 Thread Danny Yoo
> You are confusing me for the OP. Please read carefully next time before > you respond to the wrong person. > > I bumped because the OP's question was not specific and I thought I > talked about people making their requests or questions very specific if > they expect any useful replies. Hi E

Re: [Tutor] doubt in Regular expressions

2006-06-26 Thread Evans Anyokwu
Luke take note; the message was not from me! - Original Message - From: "Luke Paireepinart" <[EMAIL PROTECTED]> To: "Evans Anyokwu" <[EMAIL PROTECTED]>; Sent: Sunday, June 25, 2006 10:26 PM Subject: Re: [Tutor] doubt in Regular expressions > Post Scr

Re: [Tutor] doubt in Regular expressions

2006-06-25 Thread Luke Paireepinart
Post Script: Sorry for the double e-mail, Evans. I forgot to forward it to the list the first time. Also, why don't replies automatically forward themselves to the list like the pygame mailing list does? For privacy reasons, in case you want to reply to someone separately? End of P.S. -

Re: [Tutor] doubt in Regular expressions

2006-06-25 Thread Evans Anyokwu
bump - Original Message - From: ravi sankar To: tutor@python.org Sent: Sunday, June 25, 2006 9:17 PM Subject: [Tutor] doubt in Regular expressions hello all,  i want to search strings in the database available and return the link of the string instead  simply

[Tutor] doubt in Regular expressions

2006-06-25 Thread ravi sankar
hello all,  i want to search strings in the database available and return the link of the string instead  simply returning the words...  by using regular expressions(RE) i got a way to perform the  string matchesgive some info regarding how to return the link of the matched strings...  ravi. _

Re: [Tutor] doubt plz help

2006-06-06 Thread Ezra Taylor
Siddhart: Kent is correct, I tried the os.system('clear') on my Debian linux box and the screen clears. Don't forget to use import os. Also, I 'm new to Python. Hello community. Ezra Taylor On 6/6/06, soumitr siddharth <[EMAIL PROTECTED]> wrote: > > how do i clear the sc

Re: [Tutor] doubt plz help

2006-06-06 Thread Kent Johnson
soumitr siddharth wrote: > how do i clear the scseer ?? > suppose i have two pages to display one > after the other ,how should i do it ? It depends on the OS and the type of display. For a console application on Windows, use os.system('cls') On Linux I think the corresponding command is os.syst

Re: [Tutor] doubt plz help

2006-06-06 Thread Matthew Webber
>> Try to rephrase that question. I don't think I was the only one not understanding what you are asking? Try to rephrase that response. I'm sure that you understand the double negative in the second sentence, but many who speak English as a second language (including, possibly, the original poste

Re: [Tutor] doubt plz help

2006-06-06 Thread Øyvind
Try to rephrase that question. I don't think I was the only one not understanding what you are asking? >how do i clear the scseer ?? >suppose i have two pages to display one >after the other ,how should i do it ? -- This email has been scanned for viruses & spam by Decna as - www.decna.no De

[Tutor] doubt plz help

2006-06-05 Thread soumitr siddharth
how do i clear the scseer ?? suppose i have two pages to display one after the other ,how should i do it ? Yahoo! India Answers: Share what you know. Learn something new Click here Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now_

Re: [Tutor] doubt: 2nd part

2006-03-02 Thread Hugo González Monteverde
Hi Joaquin, Remember to Reply-All for the whole list to receive the message. Joaquin Sanchez Sanchez wrote: > Im proving pickle in python. > As I mentioned before, i do pickle.dump for two times, > because I want to save two dictionaries. > > Then to save the dictionaries, with one pickle.load()

[Tutor] DOUBT -Its urgent!!!! (fwd)

2006-03-01 Thread Danny Yoo
-- Forwarded message -- Date: Wed, 1 Mar 2006 17:12:47 +0100 (CET) From: Joaquin Sanchez Sanchez <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: DOUBT -Its urgent I have a doubt I have some modules in python, and in one of them, i have to dictionarys. In them, i have s

Re: [Tutor] Doubt with classes

2006-01-21 Thread Alan Gauld
swaroop = Person('Swaroop') swaroop.sayHi() swaroop.howMany() kalam = Person('Abdul Kalam') kalam.sayHi() kalam.howMany() swaroop.sayHi() swaroop.howMany() # MY OUTPUT (Initializing Swaroop) Hi, my name is Swaroop. I am the only person here. (Initializing Abdul K

Re: [Tutor] Doubt with classes

2006-01-20 Thread Kent Johnson
Edgar Antonio Rodríguez Velazco wrote: > Hi everybody, > I've been reading the chapter of classes of Byte of Python by Swaroop. > There's an example with classes (11.4) that is below: The example is depending on Person.__del__() being called on swaroop and kalam when the intepreter exits. The Py

[Tutor] Doubt with classes

2006-01-20 Thread Edgar Antonio Rodríguez Velazco
Hi everybody, I've been reading the chapter of classes of Byte of Python by Swaroop. There's an example with classes (11.4) that is below:   # class Person:'''Represents a person.'''population = 0 def __init__(self, name):'''Initializes the person's data.