Ask for help about class variable scope (Re: Why doesn't a dictionary work in classes?)

2018-12-26 Thread jfong
I saw the code below at stackoverflow. I have a little idea about the scope of a class, and list comprehension and generator expressions, but still can't figure out why Z4 works and Z5 not. Can someone explain it? (in a not-too-complicated way:-) class Foo(): XS = [15, 15, 15, 15] Z4 =

Need help with a message embedded in an image

2018-12-22 Thread rootsfinder
I am doing a series of puzzles. One of the puzzles has to do with a message embedded in an image. I am not familiar with python can someone please help me. Here is a link to the images and the code. https://drive.google.com/open?id=1dg5jMFtkUvKzhxv_Fqe7QMI_5x-p_CIr Thank you very much

Re: Help - Python REST API (war: Python-list Digest, Vol 183, Issue 13)

2018-12-13 Thread dieter
Afriyie Abraham Kwabena writes: > ... > Thanks for the reply maybe I did not explain myself very well but is it > possible to apply this scenario to a database server like MySQL where I can > write some python code to post, get, delete, etc to the database? However the > client (python code I h

Re: Help - Python REST API

2018-12-13 Thread dieter
oken. After the access, client can POST, GET, etc to the > server for resources. > > Can anyone help me or give guidelines how I can achieve this using python? > Am new in python (average) and need some guidelines or some links. As Ben already has pointed out, you have various option

Re: Help - Python REST API

2018-12-12 Thread Ben Finney
eb server (either from scratch, or by plugging your code into some existing web server) to listen for and respond to the HTTP requests. Have you already chosen which web server will be receiving requests? > Can anyone help me or give guidelines how I can achieve this using > python? The

Help - Python REST API

2018-12-12 Thread Afriyie Abraham Kwabena
server for resources. Can anyone help me or give guidelines how I can achieve this using python? Am new in python (average) and need some guidelines or some links. BR Abraham -- https://mail.python.org/mailman/listinfo/python-list

Re: help me in a program in python to implement Railway Reservation System using file handling technique.

2018-11-26 Thread Mario R. Osorio
; > > System should perform below operations. > > a. Reserve a ticket for a passenger. > > b. List information all reservations done for today’s trains. > > We won't do your homework for you. Have a shot at writing it yourself > first, and then if you need help, bring

Re: help me in a program in python to implement Railway Reservation System using file handling technique.

2018-11-25 Thread Bob Gailer
On Nov 24, 2018 1:35 AM, wrote: > > hello all, > please hepl me in the above program. What do you mean by "the above program"? I don't see any. python to implement Railway Reservation System using file handling technique. > > System should perform below operations. > a. Reserve a ticket for a p

Re: help me in a program in python to implement Railway Reservation System using file handling technique.

2018-11-25 Thread francis
On Saturday, 24 November 2018 14:33:29 UTC+8, jasmin amrutia wrote: > hello all, > please hepl me in the above program. python to implement Railway Reservation > System using file handling technique. > > System should perform below operations. > a. Reserve a ticket for a passenger. > b. List in

Re: help me in a program in python to implement Railway Reservation System using file handling technique.

2018-11-23 Thread Chris Angelico
rmation all reservations done for today’s trains. We won't do your homework for you. Have a shot at writing it yourself first, and then if you need help, bring specific questions to the list. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

help me in a program in python to implement Railway Reservation System using file handling technique.

2018-11-23 Thread jasminamrutia007
hello all, please hepl me in the above program. python to implement Railway Reservation System using file handling technique. System should perform below operations. a. Reserve a ticket for a passenger. b. List information all reservations done for today’s trains. -- https://mail.python.org/mai

Re: can you please help me in opening the python programming.

2018-11-23 Thread Bob Gailer
We would be glad to help. I can't tell from your question what kind of help you need so please give us more information. Have you tried to install python? If so has the installation succeeded? What do you mean by "open the programming"? What have you tried? What do yo

can you please help me in opening the python programming.

2018-11-23 Thread hello!
Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

Need help for python on my pc.

2018-11-22 Thread Sourav Banik
but nothing is working. I want your help to sort out this issue. From Sourav Banik, Dhaka,Bangladesh. -- https://mail.python.org/mailman/listinfo/python-list

Re: Need help for python on my pc.

2018-11-21 Thread boB Stepp
een reports of a recent update breaking Windows 10 file associations. One such article reporting this behavior: https://www.howtogeek.com/fyi/microsoft-broke-windows-10s-file-associations-with-a-botched-update/ which refers to this Microsoft update: https://support.microsoft.com/en-us/help/4462919/w

Re: Need help for python on my pc.

2018-11-21 Thread Calvin Spealman
Hi, I'm afraid attachments are stripped out of e-mails sent to this list. Anything you sent was not included, so you'll need to share them in some other way if you'd like to ask for help. On Wed, Nov 21, 2018 at 1:18 PM Sourav Banik wrote: > Hello Python team, > I'm us

Need help for python on my pc.

2018-11-21 Thread Sourav Banik
but nothing is working. I want your help to sort out this issue. From Sourav Banik, Dhaka,Bangladesh. -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating dice game : NEED HELP ON CHECKING ELEMENTS IN A LIST

2018-10-10 Thread Abdur-Rahmaan Janhangeer
*if any(roll != 1 and roll != 5 for roll in result):* another extract of py's beauty! Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating dice game : NEED HELP ON CHECKING ELEMENTS IN A LIST

2018-10-10 Thread Neil Cerutti
On 2018-10-06, eliteanarchyra...@gmail.com wrote: > Hi, I am new to python and would like someones help on the > following: > > After rolling 5 dice and putting the results into a list, I > need to check if any dice is not a 1 or 5. if any(roll != 1 and roll != 5 for

Re: Creating dice game : NEED HELP ON CHECKING ELEMENTS IN A LIST

2018-10-06 Thread bob gailer
result'") # comments on  using classes: class Dice:     ... # no need for die1...die5 - use list comprehension: alldice = [Dice(6) for i in range(5)] # object is a bult-in type. it is inadvisable to assign to names of built-ins # as this makes the built-in unavailable. Look up

Re: Creating dice game : NEED HELP ON CHECKING ELEMENTS IN A LIST

2018-10-06 Thread eliteanarchyracer
Well these worked like a charm. Cant say I understand some of them and will have to look into utilizing them in the future, but I appreciate everyones responses and thank you all. Never needed to check for multiple instances in a list before. Nice to have help! -- https://mail.python.org

Re: Creating dice game : NEED HELP ON CHECKING ELEMENTS IN A LIST

2018-10-06 Thread Alister via Python-list
On Sat, 06 Oct 2018 21:56:09 +0200, Thomas Jollans wrote: > On 06/10/2018 20:10, eliteanarchyra...@gmail.com wrote: >> # - THIS LINE IS WHERE I NEED HELP # ( if 2, 3, 4, 6 in list: >> ) >> print("you can roll again") >> else: >> pri

Re : Creating dice game : NEED HELP ON CHECKING ELEMENTS IN A LIST

2018-10-06 Thread armand.fouca...@telecom-bretagne.eu
thing - Armand FOUCAULT armand.fouca...@telecom-bretagne.eu Message original Objet**: Creating dice game : NEED HELP ON CHECKING ELEMENTS IN A LIST De**: eliteanarchyra...@gmail.com : python-list@python.org Cc**: Hi, I am new to python and would like someones

Re: Creating dice game : NEED HELP ON CHECKING ELEMENTS IN A LIST

2018-10-06 Thread Thomas Jollans
On 06/10/2018 20:10, eliteanarchyra...@gmail.com wrote: # - THIS LINE IS WHERE I NEED HELP # ( if 2, 3, 4, 6 in list: ) print("you can roll again") else: print("you have all 1's and 5's in your result") You can use a loop: for good_number in

Re: Creating dice game : NEED HELP ON CHECKING ELEMENTS IN A LIST

2018-10-06 Thread MRAB
On 2018-10-06 19:10, eliteanarchyra...@gmail.com wrote: Hi, I am new to python and would like someones help on the following: After rolling 5 dice and putting the results into a list, I need to check if any dice is not a 1 or 5. if all dice in the list are either a 1 or 5 , I want to

Creating dice game : NEED HELP ON CHECKING ELEMENTS IN A LIST

2018-10-06 Thread eliteanarchyracer
Hi, I am new to python and would like someones help on the following: After rolling 5 dice and putting the results into a list, I need to check if any dice is not a 1 or 5. if all dice in the list are either a 1 or 5 , I want to calculate a result. if there is a 2,3,4 or 6 in the list i want to

Re: Help please installing Python on Windows 10

2018-10-04 Thread Sibylle Koczian
Am 03.10.2018 um 09:34 schrieb Timothy Cowell via Python-list: Could I please ask for help installing Python on Windows 10 - I've tried twice (Version 3.7 for windows) selecting the install now option. After first attempt I uninstalled and tried again. Each time it has put 4 items i

Help please installing Python on Windows 10

2018-10-03 Thread Timothy Cowell via Python-list
Hi, Could I please ask for help installing Python on Windows 10 - I've tried twice (Version 3.7 for windows) selecting the install now option. After first attempt I uninstalled and tried again. Each time it has put 4 items in the programs list from the windows start button, all

Re: help me in python plssss!!!!

2018-09-14 Thread Max Zettlmeißl via Python-list
on / 2.0 > > epsilon = 2 * epsilon > > help me! > This list is not here to solve every single step of what is (presumably) your homework for you. Everything you present right here is what I helped you with in "how to convert this psuedo code to python". You will have to at least try

help me in python plssss!!!!

2018-09-14 Thread Noel P. CUA
Calculate the true, relative and approximate errors, and Relate the absolute relative approximate error to the number of significant digits. epsilon = 1 while epsilon + 1 > 1: epsilon = epsilon / 2.0 epsilon = 2 * epsilon help me! -- *This email and any files transmitted with it

Re: Help on PyList 3.7.0

2018-09-14 Thread Jason Qian via Python-list
Thanks a lot. On Thu, Sep 13, 2018 at 5:24 PM, MRAB wrote: > On 2018-09-13 21:50, Jason Qian via Python-list wrote: > >> Hey, >> >> Need some help on PyList. >> >> >> #get path >> PyObject *path = PyObject_GetAttrString(sys, &q

Re: Help on PyList 3.7.0

2018-09-13 Thread MRAB
On 2018-09-13 21:50, Jason Qian via Python-list wrote: Hey, Need some help on PyList. #get path PyObject *path = PyObject_GetAttrString(sys, "path"); #new user path PyObject* newPath = PyUnicode_DecodeUTF8(userPath, strlen( userPath ), errors); #append newPath to path PyList_A

Help on PyList 3.7.0

2018-09-13 Thread Jason Qian via Python-list
Hey, Need some help on PyList. #get path PyObject *path = PyObject_GetAttrString(sys, "path"); #new user path PyObject* newPath = PyUnicode_DecodeUTF8(userPath, strlen( userPath ), errors); #append newPath to path PyList_Append(path, newPath); How to check if the newPath is alre

Re: I need help to put the output from terminal in a csv file

2018-09-07 Thread catanaangelo
Thanks a lot, I've managed to make it work they way I wanted -- https://mail.python.org/mailman/listinfo/python-list

Re: I need help to put the output from terminal in a csv file

2018-09-07 Thread Rhodri James
On 07/09/18 13:55, catanaang...@gmail.com wrote: HI! I need help putting the output from terminal in a csv file. I work on linux and I have python 2.7.15. I am running a python program which also runs some shell scripts. I need to capture the output from the .sh scripts and put it nicely in a

Re: I need help to put the output from terminal in a csv file

2018-09-07 Thread Brian Oney via Python-list
; {    "error" : {   "body" : "The requested device is currently not online.",   "detail" : "Make sure to connect the device",   "event" : 123456,   "header" : "Device Unavailable (123456)"    } } '

I need help to put the output from terminal in a csv file

2018-09-07 Thread catanaangelo
HI! I need help putting the output from terminal in a csv file. I work on linux and I have python 2.7.15. I am running a python program which also runs some shell scripts. I need to capture the output from the .sh scripts and put it nicely in a csv table. I am using "commands.getoutput(

Re: Help Needed : script weird result.

2018-09-01 Thread mohan4h
On Sunday, September 2, 2018 at 1:12:17 AM UTC+8, moh...@gmail.com wrote: > All, > > I m trying to run this small script to find the lowest of the given array of > numbers. The script works fine for various combination of inputs but fails in > a weird way for a particular set of inputs, can anyo

Re: Help Needed : script weird result.

2018-09-01 Thread Peter Pearson
On Sat, 1 Sep 2018 10:11:59 -0700 (PDT), moha...@gmail.com wrote: > All, > > I m trying to run this small script to find the lowest of the given > array of numbers. The script works fine for various combination of > inputs but fails in a weird way for a particular set of inputs, can > anyone point

Re: Help Needed : script weird result.

2018-09-01 Thread Dan Sommers
On 9/1/18 1:11 PM, moha...@gmail.com wrote: All, I m trying to run this small script to find the lowest of the given array of numbers. The script works fine for various combination of inputs but fails in a weird way for a particular set of inputs, can anyone point the mistake in the script an

Re: Help Needed : script weird result.

2018-09-01 Thread Joel Goldstick
On Sat, Sep 1, 2018 at 1:26 PM duncan smith wrote: > > On 01/09/18 18:11, moha...@gmail.com wrote: > > All, > > > > I m trying to run this small script to find the lowest of the given array > > of numbers. The script works fine for various combination of inputs but > > fails in a weird way for a

Re: Help Needed : script weird result.

2018-09-01 Thread duncan smith
On 01/09/18 18:11, moha...@gmail.com wrote: > All, > > I m trying to run this small script to find the lowest of the given array of > numbers. The script works fine for various combination of inputs but fails in > a weird way for a particular set of inputs, can anyone point the mistake in > the

Help Needed : script weird result.

2018-09-01 Thread mohan4h
All, I m trying to run this small script to find the lowest of the given array of numbers. The script works fine for various combination of inputs but fails in a weird way for a particular set of inputs, can anyone point the mistake in the script and the behavior. Script x = input ("Enter the

help! PyQt4 and UTF-8

2018-08-14 Thread inhahe
it here I get "testing😀" ("testing" with a smiley face after it, like I want), so I guess displaying it in the font is the problem, but I don't know why.. as you can see, both the wxPython and the PyQt examples use "Arial." I've also tried "FixedSys Excelsior 3.01". Python version: CPython 2.7.14 OS: Windows 10 thanks for any help -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.7 Windows Help Behaviour

2018-07-03 Thread BlindAnagram
On 03/07/2018 03:41, Terry Reedy wrote: > On 7/2/2018 8:57 PM, Steven D'Aprano wrote: >> On Fri, 29 Jun 2018 12:53:15 -0400, Terry Reedy wrote: >> >>> On 6/29/2018 6:14 AM, BlindAnagram wrote: >>>> In Python 3.7.0 on Windows the help file (python370.chm) d

Re: Python 3.7 Windows Help Behaviour

2018-07-02 Thread Terry Reedy
On 7/2/2018 8:57 PM, Steven D'Aprano wrote: On Fri, 29 Jun 2018 12:53:15 -0400, Terry Reedy wrote: On 6/29/2018 6:14 AM, BlindAnagram wrote: In Python 3.7.0 on Windows the help file (python370.chm) displays with a fixed line length and does not adjust its line length when the user expand

Re: Python 3.7 Windows Help Behaviour

2018-07-02 Thread Steven D'Aprano
On Fri, 29 Jun 2018 12:53:15 -0400, Terry Reedy wrote: > On 6/29/2018 6:14 AM, BlindAnagram wrote: >> In Python 3.7.0 on Windows the help file (python370.chm) displays with >> a fixed line length and does not adjust its line length when the user >> expands the help windo

Re: Python 3.7 Windows Help Behaviour

2018-07-02 Thread Roel Schroeven
BlindAnagram schreef op 30/06/2018 15:50: On 30/06/2018 10:43, Steven D'Aprano wrote: On Fri, 29 Jun 2018 12:53:15 -0400, Terry Reedy wrote: On 6/29/2018 6:14 AM, BlindAnagram wrote: In Python 3.7.0 on Windows the help file (python370.chm) displays with a fixed line length and doe

Re: Python 3.7 Windows Help Behaviour

2018-06-30 Thread BlindAnagram
On 30/06/2018 10:43, Steven D'Aprano wrote: > On Fri, 29 Jun 2018 12:53:15 -0400, Terry Reedy wrote: > >> On 6/29/2018 6:14 AM, BlindAnagram wrote: >>> In Python 3.7.0 on Windows the help file (python370.chm) displays with >>> a fixed line length and does not a

Re: Python 3.7 Windows Help Behaviour

2018-06-30 Thread Steven D'Aprano
On Fri, 29 Jun 2018 12:53:15 -0400, Terry Reedy wrote: > On 6/29/2018 6:14 AM, BlindAnagram wrote: >> In Python 3.7.0 on Windows the help file (python370.chm) displays with >> a fixed line length and does not adjust its line length when the user >> expands the help windo

Re: Python 3.7 Windows Help Behaviour

2018-06-30 Thread BlindAnagram
On 29/06/2018 17:53, Terry Reedy wrote: > On 6/29/2018 6:14 AM, BlindAnagram wrote: >> In Python 3.7.0 on Windows the help file (python370.chm) displays with a >> fixed line length and does not adjust its line length when the user >> expands the help window horizontall

Re: Python 3.7 Windows Help Behaviour

2018-06-29 Thread Terry Reedy
On 6/29/2018 6:14 AM, BlindAnagram wrote: In Python 3.7.0 on Windows the help file (python370.chm) displays with a fixed line length and does not adjust its line length when the user expands the help window horizontally. This behaviour is different to that of the Python 3.6 help file (python360

Python 3.7 Windows Help Behaviour

2018-06-29 Thread BlindAnagram
In Python 3.7.0 on Windows the help file (python370.chm) displays with a fixed line length and does not adjust its line length when the user expands the help window horizontally. This behaviour is different to that of the Python 3.6 help file (python360.chm) which adjusts its text to fit the

Re: help install on Win 7

2018-06-28 Thread Rhodri James
On 28/06/18 02:23, Andrew von Bevern wrote: I have tried to install python on my home laptop several times, using 3.6 or 3.7. Each time I get the following error - anyone know what I am doing wrong? [image: image.png] I'm sorry, but this mailing list removes attachments (for perfectly sensible

Re: help install on Win 7

2018-06-28 Thread Abdur-Rahmaan Janhangeer
text-only list, can you please copy paste the error? thank you, Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ > -- https://mail.python.org/mailman/listinfo/python-list

help install on Win 7

2018-06-28 Thread Andrew von Bevern
I have tried to install python on my home laptop several times, using 3.6 or 3.7. Each time I get the following error - anyone know what I am doing wrong? [image: image.png] thanks in advance Andrew -- https://mail.python.org/mailman/listinfo/python-list

Help with 'site' package.

2018-06-04 Thread Erik Martinson via Python-list
I am trying to dynamically add a site-package to a script that is run as a cron job. The method adduseristepackages does not seem to do anything. import sys import site print('-')print(site.getusersitepackages()) print('add', site.addusersitepackages('/home/erik/.local/l

Re: help

2018-05-29 Thread Steven D'Aprano
ike us to try to guess? The best way to get help is to COPY AND PASTE (do not re-type from memory, do not paraphrase or summarise) the EXACT errors you are getting. We need to know *exactly* what you are trying to do (if you are using pip, copy and paste the EXACT pip command you are using, if

help

2018-05-28 Thread Mutyala Veera Vijaya Teja
Hello, This is vijayteja am getting an error like ssl certificate failure when try to install packages. I've searched in the internet I've not got any correct solution please maintain python's official blog which contains all python issues and problems and how to solve them. Thanks & Re

Re: I need help with this python regex

2018-04-28 Thread Peter J. Holzer
On 2018-04-27 21:04:49 -0700, Ed Manning wrote: > Here is the source code. > > > import re > > > log = open("csg.txt", "r") # Opens a file call session.txt > regex = re.compile(r'policy id \d+') # search for the policy ID > regex1 = re.compile(r'log count \d+') # search for the policy ID > > f

I need help with this python regex

2018-04-27 Thread Ed Manning
Here is the source code. import re log = open("csg.txt", "r") # Opens a file call session.txt regex = re.compile(r'policy id \d+') # search for the policy ID regex1 = re.compile(r'log count \d+') # search for the policy ID for match in log: x = regex.findall(match) y = regex1.findall(m

Re: setuptools setup.py commands are unintuitive and undiscoverable (--help-commands should replace --help)

2018-04-27 Thread Thomas Jollans
> > Surprisingly, neither "setup.py" nor "setup.py --help" doesn't provide a > list of options either, instead telling you how to show various metadata > options which are not useful to end users of the software project, trying > to build/install it. > &g

setuptools setup.py commands are unintuitive and undiscoverable (--help-commands should replace --help)

2018-04-27 Thread jimbo1qaz
Frequently I have encountered projects packaged using setuptools, with a setup.py. To find out how to install it, I usually turned to Stack Overflow (https://stackoverflow.com/a/1472014) which doesn't explain what options exist or do. Surprisingly, neither "setup.py" nor "setu

Re: How to access the help page of SRE_Pattern?

2018-03-05 Thread Steven D'Aprano
On Mon, 05 Mar 2018 18:13:59 -0600, Peng Yu wrote: > Hi, > >>>> import re >>>> prog=re.compile('[a-f]+') >>>> help(prog) > > I can use the above command to access SRE_Pattern. But this involves the > creation of an object of the class

How to access the help page of SRE_Pattern?

2018-03-05 Thread Peng Yu
Hi, >>> import re >>> prog=re.compile('[a-f]+') >>> help(prog) I can use the above command to access SRE_Pattern. But this involves the creation of an object of the class. I tried to directly access the class. But it does not work. Does anybody know if

Help me with the Python! ODE system.

2018-03-02 Thread alenkabor129769
I can not find an example with this function: https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.RK45.html#scipy.integrate.RK45. -- https://mail.python.org/mailman/listinfo/python-list

Re: help me ? (Posting On Python-List Prohibited)

2018-03-01 Thread Rustom Mody
On Thursday, March 1, 2018 at 5:37:28 AM UTC+5:30, Steven D'Aprano wrote: > On Wed, 28 Feb 2018 09:58:24 -0800, Aktive wrote: > > > what the hell do you care about cheating.. > > > > the world doest care about cheating. > > > > its about skill. > > Because cheaters don't have skill. That's why

Re: help me ? (Posting On Python-List Prohibited)

2018-02-28 Thread Steven D'Aprano
On Wed, 28 Feb 2018 09:58:24 -0800, Aktive wrote: > what the hell do you care about cheating.. > > the world doest care about cheating. > > its about skill. Because cheaters don't have skill. That's why they cheat. > You guys been too much in school Ah, spoken like a cheater. -- Steve

Re: help me ? (Posting On Python-List Prohibited)

2018-02-28 Thread Aktive
On Wednesday, 28 February 2018 06:00:07 UTC+1, Lawrence D’Oliveiro wrote: > On Wednesday, February 28, 2018 at 4:44:04 PM UTC+13, jlad...@itu.edu wrote: > > This is part of the reason why interviews for software developer jobs > > have gotten so crazy. > > This is why you need to have a CV that b

Re: help me ?

2018-02-27 Thread Rick Johnson
On Tuesday, February 27, 2018 at 12:56:52 PM UTC-6, Grant Edwards wrote: [...] > The fun part is giving them a solution that's so obscure and "clever" > that it technically meets the stated requirement but is so far from > what the instructor wanted that they don't get credit for it (and > there's

Re: help me ?

2018-02-27 Thread amber
On 02/27/2018 06:54 PM, Grant Edwards wrote: > The fun part is giving them a solution that's so obscure and "clever" > that it technically meets the stated requirement but is so far from > what the instructor wanted that they don't get credit for it (and > there's no way the student will be able

Re: help me ?

2018-02-27 Thread jladasky
On Tuesday, February 27, 2018 at 10:56:52 AM UTC-8, Grant Edwards wrote: > If the student is actively trying to avoid learning something, there's > nothing you can do to help them. They're just wasting their own time > and money. This is part of the reason why interviews for

Re: help me ?

2018-02-27 Thread Michael F. Stemper
On 2018-02-26 07:17, Stefan Ram wrote: Percival John Hackworth quoted: Define 2 lists. The first one must contain the integer values 1, 2 and 3 a =[ 1, 2, 3 ] and the second one the string values a, b and c. b =[ 'a', 'b', 'c'] Iterate through both lists to create another list that cont

Re: help me ?

2018-02-27 Thread Steven D'Aprano
worth > the bother to engage. Its worth the bother for the 5% who aren't *intentionally* cheating, but don't realise it, and just need a reminder that they need to do the work themselves. (Or at least give co-credit to those they got help from.) Or those who aren't actually do

Re: help me ?

2018-02-27 Thread Ian Kelly
On Tue, Feb 27, 2018 at 2:50 PM, Andre Müller wrote: > Hello, > > it's a duplicate: > https://python-forum.io/Thread-Working-with-lists-homework-2 > > I have seen this more than one time. We don't like it. You keep people busy > with one question at different places. You assume that it was posted

Re: help me ?

2018-02-27 Thread Andre Müller
st1 = [str(i) + c for i in range(1,4) for c in letter[:3]] list2 = [c[::-1] for c in list1] But this won't help you. Before you understand the code above, you have to understand for-loops and nested for-loops. Then you can proceed with list comprehensions. But I don't see that your inten

Re: help me ?

2018-02-27 Thread Grant Edwards
blems and hands up the answer on a silver platter. If the student is actively trying to avoid learning something, there's nothing you can do to help them. They're just wasting their own time and money. The fun part is giving them a solution that's so obscure and "clever"

Re: help me ?

2018-02-27 Thread Ziggy
On 2018-02-26, sotaro...@gmail.com wrote: > > Help me ! a=[1,2,3,] b=["a","b","c"] x=[] z=[] bonus=[] for digits in a: for letters in b: x.append(str(digits) + letters) bonus.append(letters + str(digits)) for

Re: help me ?

2018-02-27 Thread Larry Martell
On Tue, Feb 27, 2018 at 12:56 PM, Ian Kelly wrote: > On Tue, Feb 27, 2018 at 10:16 AM, Igor Korot wrote: >> Congratulations! >> You have an "A" for solving the problem and "F" for helping the guy cheat. >> You should be expelled from the course. > > In my experience, this is what happens pretty m

Re: help me ?

2018-02-27 Thread Ian Kelly
On Tue, Feb 27, 2018 at 10:16 AM, Igor Korot wrote: > Congratulations! > You have an "A" for solving the problem and "F" for helping the guy cheat. > You should be expelled from the course. In my experience, this is what happens pretty much every time. Somebody posts a homework question asking fo

Re: help me ?

2018-02-27 Thread Igor Korot
l possible combinations : [1a, a1, 1b, >>b1, 1c, c1, 2a, a2, 2b, b2, 2c, c2, 3a, a3, 3b, b3, 3c, c3] >> >>Help me ! > > #a list of integers > nums = [1, 2, 3] > > #a list of letters > ltrs = ['a', 'b', 'c'] > > #a list to ho

Re: help me ?

2018-02-27 Thread Sir Real
e A and B >elements. The final list should look like one of the 2 lists: >1. [1a, 1b, 1c, 2a, 2b, 2c, 3a, 3b, 3c] >2. [a1, a2. a3, b1, b2, b3, c1, c2, c3] >BONUS: Make the final list contain all possible combinations : [1a, a1, 1b, >b1, 1c, c1, 2a, a2, 2b, b2, 2c, c2, 3a, a3, 3b,

Re: help me ?

2018-02-27 Thread alister via Python-list
lements. The final list should look like one of the 2 lists: > 1. [1a, 1b, 1c, 2a, 2b, 2c, 3a, 3b, 3c] > 2. [a1, a2. a3, b1, b2, b3, c1, c2, c3] > BONUS: Make the final list contain all possible combinations : [1a, a1, > 1b, b1, 1c, c1, 2a, a2, 2b, b2, 2c, c2, 3a, a3, 3b, b3, 3c, c3] >

Re: help me ?

2018-02-26 Thread ziggyvimar
e A and B > elements. The final list should look like one of the 2 lists: > 1. [1a, 1b, 1c, 2a, 2b, 2c, 3a, 3b, 3c] > 2. [a1, a2. a3, b1, b2, b3, c1, c2, c3] > BONUS: Make the final list contain all possible combinations : [1a, a1, 1b, > b1, 1c, c1, 2a, a2, 2b, b2, 2c, c2, 3a, a3, 3b

Re: help me ?

2018-02-26 Thread Lutz Horn
Define 2 lists. ... [...] Help me ! Sounds like homework. Have you tried anything? Does it work? -- https://mail.python.org/mailman/listinfo/python-list

Re: help me ?

2018-02-26 Thread Peter Otten
Christian Gollwitzer wrote: > Am 26.02.18 um 10:40 schrieb sotaro...@gmail.com: >> Define 2 lists. The first one must contain the integer values 1, 2 and 3 >> and the second one the string values a, b and c. Iterate through both >> lists to create another list that contains all the combinations of

Re: help me ?

2018-02-26 Thread Christian Gollwitzer
Am 26.02.18 um 10:40 schrieb sotaro...@gmail.com: Define 2 lists. The first one must contain the integer values 1, 2 and 3 and the second one the string values a, b and c. Iterate through both lists to create another list that contains all the combinations of the A and B elements. The final li

help me ?

2018-02-26 Thread sotaro237
, 1c, 2a, 2b, 2c, 3a, 3b, 3c] 2. [a1, a2. a3, b1, b2, b3, c1, c2, c3] BONUS: Make the final list contain all possible combinations : [1a, a1, 1b, b1, 1c, c1, 2a, a2, 2b, b2, 2c, c2, 3a, a3, 3b, b3, 3c, c3] Help me ! -- https://mail.python.org/mailman/listinfo/python-list

Re: could use some help with this problem! (Posting On Python-List Prohibited)

2018-02-20 Thread Terry Reedy
On 2/20/2018 7:59 PM, Ben Bacarisse wrote: Lawrence D’Oliveiro writes: On Wednesday, February 21, 2018 at 3:10:25 AM UTC+13, Ben Bacarisse wrote: You almost never /have/ to use nested loops. Has the course got this far without introducing the idea of a function? If you are using a function

Re: could use some help with this problem! (Posting On Python-List Prohibited)

2018-02-20 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Wednesday, February 21, 2018 at 3:10:25 AM UTC+13, Ben Bacarisse wrote: >> You almost never /have/ to use nested loops. Has the course got this >> far without introducing the idea of a function? > > If you are using a function to avoid a nested loop, perhaps that

Re: could use some help with this problem! I've been working on it for days but cant seem to get it right !

2018-02-20 Thread Ben Bacarisse
Marc Cohen writes: > USING PYTHON 2: Why is that? > Write a program to play this game. This may seem tricky, so break it > down into parts. Like many programs, we have to use nested loops (one > loop inside another). In the outermost loop, we want to keep playing > until we are out of stones.

Re: could use some help with this problem! I've been working on it for days but cant seem to get it right !

2018-02-19 Thread breamoreboy
On Tuesday, February 20, 2018 at 5:08:49 AM UTC, Marc Cohen wrote: > USING PYTHON 2: > > Write a program to play this game. This may seem tricky, so break it down > into parts. Like many programs, we have to use nested loops (one loop inside > another). In the outermost loop, we want to keep pla

could use some help with this problem! I've been working on it for days but cant seem to get it right !

2018-02-19 Thread Marc Cohen
USING PYTHON 2: Write a program to play this game. This may seem tricky, so break it down into parts. Like many programs, we have to use nested loops (one loop inside another). In the outermost loop, we want to keep playing until we are out of stones. Inside that, we want to keep alternating p

Re: Help on convert PyObject to string (c) Python 3.6

2018-02-19 Thread Jason Qian via Python-list
Thanks a lot and I will take a look Cython, On Mon, Feb 19, 2018 at 3:23 PM, Stefan Behnel wrote: > Jason Qian via Python-list schrieb am 04.02.2018 um 17:52: > >This is the case of calling python from c and the python function > will > > return a string. > > Hi Jason, > > I noticed that you

Re: Help on convert PyObject to string (c) Python 3.6

2018-02-19 Thread Stefan Behnel
Jason Qian via Python-list schrieb am 04.02.2018 um 17:52: >This is the case of calling python from c and the python function will > return a string. Hi Jason, I noticed that you ran into a couple of problems using the C-API, so I suggest looking into Cython instead. It basically translates

Re: Help on PyImport_Import(pNAme)

2018-02-04 Thread dieter
Jason Qian via Python-list writes: > This only works when loading modules from the current directory. > Is there a way I can load from somewhere else ? Have a look at the module `importlib` and especially its function `import_module`. Python knows about two forms of "import": "absolute imp

Help on PyImport_Import(pNAme)

2018-02-04 Thread Jason Qian via Python-list
Hi, This only works when loading modules from the current directory. Is there a way I can load from somewhere else ? Thanks for help, -- https://mail.python.org/mailman/listinfo/python-list

Re: Help on convert PyObject to string (c) Python 3.6

2018-02-04 Thread Jason Qian via Python-list
Hi Chris, Thanks a lot ! Using PyUnicode_DecodeUTF8 fix the problem. On Sun, Feb 4, 2018 at 12:02 PM, Chris Angelico wrote: > On Mon, Feb 5, 2018 at 3:52 AM, Jason Qian via Python-list > wrote: > > Hi, > > > >This is the case of calling python from c and the python function > will > >

Re: Help on convert PyObject to string (c) Python 3.6

2018-02-04 Thread Chris Angelico
On Mon, Feb 5, 2018 at 3:52 AM, Jason Qian via Python-list wrote: > Hi, > >This is the case of calling python from c and the python function will > return a string. > >It seems python been called correctly, but got error when convert the > python string to c string. > > -- c -- > >PyO

Help on convert PyObject to string (c) Python 3.6

2018-02-04 Thread Jason Qian via Python-list
, "s", &sp)) { } and got "SystemError: new style getargs format but argument is not a tuple" Thanks for the help -- https://mail.python.org/mailman/listinfo/python-list

<    2   3   4   5   6   7   8   9   10   11   >