On Sun, Aug 18, 2019 at 12:35:52PM +0800, Thejal Ramesh wrote:
> Hi, i have a question regarding this question. I'm not quite sure what the
> question is asking.
Ask your tutor. We can help you with learning Python the programming
language, not graph theory.
https://en.wikipedia.org/wiki/Graph_t
On 18/08/2019 05:35, Thejal Ramesh wrote:
> Hi, i have a question regarding this question. I'm not quite sure what the
> question is asking.
> Part A: Popular (1.5 Marks)
> Write a function popular(graph list, n) that returns a list of people who
> have at least n friends. Each person is identifi
Hi, i have a question regarding this question. I'm not quite sure what the
question is asking.
Part A: Popular (1.5 Marks)
Write a function popular(graph list, n) that returns a list of people who
have at least n friends. Each person is identified by the number of their
vertex.
Input: a nested lis
maybe a copy/paste of your terminal session so we can see the text of the steps
you are actually performing will give use some clues.
—
David
> On Aug 1, 2019, at 18:22, David L Neil wrote:
>
> On 2/08/19 3:23 AM, Spencer Wannemacher wrote:
>> I'm new to python and I was trying to perform a si
On 2/08/19 3:23 AM, Spencer Wannemacher wrote:
I'm new to python and I was trying to perform a simple one code. All that is
included in the code is print(61). I save it as 61.py and change the directory
before typing in python 61.py and I don't get an output. There is no error and
the output i
On 01Aug2019 15:23, Spencer Wannemacher wrote:
I'm new to python and I was trying to perform a simple one code. All
that is included in the code is print(61). I save it as 61.py and
change the directory before typing in python 61.py and I don't get an
output. There is no error and the output i
I'm new to python and I was trying to perform a simple one code. All that is
included in the code is print(61). I save it as 61.py and change the directory
before typing in python 61.py and I don't get an output. There is no error and
the output is blank. Please let me know what I'm doing wrong.
Hi everyone,
I'm a developer with just over 10 years' experience under my belt. I've
worked with many languages and frameworks, including the popular Django web
framework.
I'm currently in the market for remote opportunities. Please reply if
looking for a resource. Serious enquiries only please.
What (precisely) did you type to "start python through idle"? Don't guess - cut
and pasted EXACTLY what you type and what you see on screen.
S.
-Original Message-
From: Tutor On Behalf Of
siva
Sent: 24 July 2019 08:57
To: tutor@python.org
Subject: [Tutor] python idl
I have tried to start python through idle .but the software didn’t start.it
displays “subprocess error”.tell me some solution.
Thank you.
Sent from Mail for Windows 10
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription optio
On Wed, Jul 24, 2019 at 11:26:26AM +1200, David L Neil wrote:
> Clarifying the difference/similarity in appearance between a generator
> expression and a tuple, it might help to think that it is the comma(s)
> which make it a tuple!
David makes an excellent point here. Except for the special ca
On Tue, Jul 23, 2019 at 10:36:01PM +0530, Animesh Bhadra wrote:
> Hi All,
>
> Need one help in understanding generator expression/comprehensions.
>
> This is my sample code.
Lots of missing spaces in your code! Don't forget to hit the space bar
between words :-)
Also missing indentation, which
On 7/23/19 11:06 AM, Animesh Bhadra wrote:
> Hi All,
>
> Need one help in understanding generator expression/comprehensions.
>
> This is my sample code.
>
> # This code creates a generator and not a tuple comprehensions.
> my_square =(num *num fornum inrange(11))
> print(my_square) # at 0x7f3c8
Hi Animesh,
Unfortunately the list server/email has removed the formatting from your
sample, but no matter...
On 24/07/19 5:06 AM, Animesh Bhadra wrote:
# This code creates a generator and not a tuple comprehensions.
my_square =(num *num fornum inrange(11))
print(my_square) # at 0x7f3c838c0c
Hi All,
Need one help in understanding generator expression/comprehensions.
This is my sample code.
# This code creates a generator and not a tuple comprehensions.
my_square =(num *num fornum inrange(11))
print(my_square) # at 0x7f3c838c0ca8>
# We can iterate over the square generator like thi
On 25 Jun 2019 15:50, stephen.m.sm...@comcast.net wrote:
Introduction:
I have written a 'program' that does some reasonable screen scraping off of
a specific website. The program has gotten too large so I have tried to
segment it into logical pieces (tkinter logic as a start) but I am having
pr
On Sat, Jun 29, 2019 at 2:02 AM David Merrick wrote:
>
> Hi Looking for a way to use the determine the position of a card in a grid
> using the mouse click event in Python. Code is attached. There are no
> viruses.
>
> Unfortunately using Tinkter grids / frames can't determine between the two
> de
On Jun 28, 2019 9:26 AM, "Erastus muriithi"
wrote:
>
> Iam a student..iam interested in learning python,,I don't know how to
study this python.kindly help me how to go about it..Thankyou
First make sure you have python installed on your computer. If you need
help with that let us know what kind o
On Jun 29, 2019 3:01 AM, "David Merrick" wrote:
>
> Hi Looking for a way to use the determine the position of a card in a grid
> using the mouse click event in Python. Code is attached.
Unfortunately this list does not forward attachments. Either give us a link
to the code or even better if it's
Hi Looking for a way to use the determine the position of a card in a grid
using the mouse click event in Python. Code is attached. There are no
viruses.
Unfortunately using Tinkter grids / frames can't determine between the two
demo cards.
Any suggestions are welcome
--
Dave Merrick
TutorInve
Hi Looking for a way to use the determine the position of a card in a grid
using the mouse click event in Python. Code is attached.
Unfortunately using Tinkter grids / frames can't determine between the two
demo cards.
The Relevant code is below
def showCardInitial(cardList):
cardsToPlay = [
On 27/06/2019 22:20, Brave Heart via Tutor wrote:
> I would like python to write to DB so I can from DB write on a webpage with
> PHP...
Yes, that's easy enough. Python supports access to many databases,
do you have one in mind? If not the SQLite module that comes in
the standard library is prob
On 27Jun2019 23:20, Brave Heart wrote:
I have a little RSS program , I current the out are basically outputted on my
screen, but I would like python to write to DB so I can from DB write on a
webpage with PHP...
Kinda like I want to run a news website ..
See the "sqlite3" module with ships
On 6/27/19 3:20 PM, Brave Heart via Tutor wrote:
> I have a little RSS program , I current the out are basically outputted on my
> screen, but I would like python to write to DB so I can from DB write on a
> webpage with PHP...
>
> Kinda like I want to run a news website ..
There doesn't seem
I have a little RSS program , I current the out are basically outputted on my
screen, but I would like python to write to DB so I can from DB write on a
webpage with PHP...
Kinda like I want to run a news website ..
Sent from Mail for Windows 10
___
On 25/06/2019 14:50, stephen.m.sm...@comcast.net wrote:
> using global, but that fails. I also can't seem to use arguments because the
> module that tkinter fires up with this command:
>
> self.process_button = tk.Button(master, text='Process Request', \
>
Introduction:
I have written a 'program' that does some reasonable screen scraping off of
a specific website. The program has gotten too large so I have tried to
segment it into logical pieces (tkinter logic as a start) but I am having
problems. Specifically I need to pass several dictionaries to
On Jun 25, 2019 8:52 AM, "Shaon Debnath" wrote:
>
> I just wanted to know all about map() function in python.
See https://www.geeksforgeeks.org/python-map-function/.
If after reading that you still have questions please come back and ask
them.
Bob Gailer
I just wanted to know all about map() function in python.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 6/24/19 12:48 PM, Arup Rakshit wrote:
> I am little experimenting with Python type annotation today. I wrote a simple
> class as below:
>
from datetime import date
class Person:
> ... dob: date
> ... def __init__(self, dob):
> ... self.dob = dob
> ...
Person
I am little experimenting with Python type annotation today. I wrote a simple
class as below:
>>> from datetime import date
>>> class Person:
... dob: date
... def __init__(self, dob):
... self.dob = dob
...
>>> Person(11)
<__main__.Person object at 0x10e078128>
>>> p = Perso
From: Cameron Simpson
Sent: Monday, June 10, 2019 5:34 PM
To: Sai Allu
Cc: Mats Wichmann; tutor@python.org; Deepak Dixit
Subject: Re: [Tutor] Python printing parentheses and quotes
On 10Jun2019 19:04, Sai Allu wrote:
>Actually I'm pretty sure what happened was that the "#! usr/bin/python&
On 10Jun2019 19:04, Sai Allu wrote:
Actually I'm pretty sure what happened was that the "#! usr/bin/python" was in
a module that was being imported. So the Python interpreter cached it or somehow crashed
randomly, which meant that the print was working as a keyword instead of a function.
But
hat "#! usr/bin/python" line and then rewrote the print
statements, it went back to working normally.
Thank you for the help though!
Sai Allu
From: Sai Allu
Sent: Monday, June 10, 2019 11:53 AM
To: Mats Wichmann; tutor@python.org; Deepak Dixit
Subject: Re
: Sai Allu; tutor@python.org
Subject: Re: [Tutor] Python printing parentheses and quotes
On 6/10/19 10:50 AM, Sai Allu wrote:
> Hello!
>
> I was just wondering if anybody encountered an issue where the Python
> interpreter was changing how it interprets print statements. So I'm usin
On 10/06/2019 17:50, Sai Allu wrote:
> Basically what happened was that I had a few lines in the script like this
> ip = "10.41.17.237"
> print(" Welcome to Squid Monitoring for ", ip)
> print("")
>
> and the output was like this
>
> (" Welcome to Squid Monitoring for 10.41.17.
On 6/10/19 10:50 AM, Sai Allu wrote:
> Hello!
>
> I was just wondering if anybody encountered an issue where the Python
> interpreter was changing how it interprets print statements. So I'm using
> default Python on Mac OSX (2.7.10 I'm pretty sure) and running with the
> "python script.py" comm
Hello!
I was just wondering if anybody encountered an issue where the Python
interpreter was changing how it interprets print statements. So I'm using
default Python on Mac OSX (2.7.10 I'm pretty sure) and running with the "python
script.py" command.
Basically what happened was that I had a fe
Thanks Cameron,
Just got lucky yesterday and found a resource at my end to help me out.
Thank you
On Tue, 2 Apr 2019 at 04:31, Cameron Simpson wrote:
>
> On 29Mar2019 21:18, nitin chandra wrote:
> >Hi Everyone,
> >I need some guidance / corrections to my code.
> >I hosted a demo site on python
On 29Mar2019 21:18, nitin chandra wrote:
Hi Everyone,
I need some guidance / corrections to my code.
I hosted a demo site on pythonanywhere.com and to test the initial
pages I wrote some test code.
[...]
Hi Nitin,
I looks like nobody has replied; this probably means that nobody has the
requi
Hi Everyone,
I need some guidance / corrections to my code.
I hosted a demo site on pythonanywhere.com and to test the initial
pages I wrote some test code.
Good news, put in 10 hrs, tried so many suggestion given on the net,
yet non worked. So finally mailing the list.
Objective : display main
On 04/03/2019 08:04, Edward Kanja wrote:
> ... Unfortunately after i extract the data
> my output has too much of square brackets and by so doing the output cant
> be well exported in a csv file.
I can't see the data so can't be definitive but the number of square
brackets shouldn't affect a CSV
Hi Edward, and welcome.
Please remember that we're volunteers, doing this for free. Unless your
problem is really interesting, you're not likely to get people
volunteering to spend a long time slogging through multiple attachments,
screenshots, at least five seperate attempts, etc.
By the way,
Hi there,
Hope this finds you well, I'm working on a simple project to analyse data
using
regular expressions. I have successfully worked on a regular expression
pattern
that extracts data from my txt file. Unfortunately after i extract the data
my output has too much of square brackets and by so d
On 2/14/19 9:44 AM, Simon Connah wrote:
> Hi,
>
> I was wondering what the best practice for writing web socket servers in
> Python was in 2019? I found an old example on the web which used the
> tornado library but that was talking about Chrome 22 as the client which
> is ancient now so I'm not s
On 14/02/2019 16:44, Simon Connah wrote:
> I was wondering what the best practice for writing web socket servers in
> Python was in 2019?
I can't answer that directly since I've never used web
sockets in Python (and only played with them in Java).
But...
> I found an old example on the web whi
Hi,
I was wondering what the best practice for writing web socket servers in
Python was in 2019? I found an old example on the web which used the
tornado library but that was talking about Chrome 22 as the client which
is ancient now so I'm not sure if things have changed?
Any suggestions on
On 27/01/2019 14:57, Asad wrote:
> print("first:", args.first)
> print("second:", args.second)
>
> When I execute the script it gives error :
>
> python python_json_20001_oratest_v1.py "file1"
> ('first:', 'file1')
> ('second:', None)
Note that the second file is None.
> Traceback (most recent
Asad wrote:
> Hi All ,
>
> I tried the following code :
>
> parser = argparse.ArgumentParser()
> parser.add_argument("first")
> parser.add_argument("second", nargs="?")
> args = parser.parse_args()
> print("first:", args.first)
>
> print("second:", args.second)
>
> When I execute th
arded message --
> From: Peter Otten <__pete...@web.de>
> To: tutor@python.org
> Cc:
> Bcc:
> Date: Sun, 27 Jan 2019 10:30:12 +0100
> Subject: Re: [Tutor] python - files
> Cameron Simpson wrote:
>
> > Mats has mentioned the modules getopt and argparse
On 27Jan2019 10:30, Peter Otten <__pete...@web.de> wrote:
Cameron Simpson wrote:
Mats has mentioned the modules getopt and argparse etc. These are
primarily aimed at option parsing ("-v", "-o foo"). Your situation
occurs _after_ the option parsing (in your case, there are no options).
Not argp
Cameron Simpson wrote:
> Mats has mentioned the modules getopt and argparse etc. These are
> primarily aimed at option parsing ("-v", "-o foo"). Your situation
> occurs _after_ the option parsing (in your case, there are no options).
Not argparse. The main advantage over optparse is its handling
Mats has mentioned the modules getopt and argparse etc. These are
primarily aimed at option parsing ("-v", "-o foo"). Your situation
occurs _after_ the option parsing (in your case, there are no options).
Alan has talked about explicitly checking the length of sys.argv, much
as you are doing,
On 1/26/19 1:20 AM, Asad wrote:
> Hi All ,
>
>I would like to know how do I make and option file as an argument on
> command propmnt in python
I don't know your context for asking this question. Alan has already
explained what you need to do for your issue, and whatever your needs it
is
On 26/01/2019 08:20, Asad wrote:
>At present I using :
>
> if len(sys.argv) == 3:
> first = sys.argv[1]
> second = sys.argv[2]
> else:
> print "enter the second argument"
> It works well for the following command :
> python test.py file1 file2
Correct because it tests if the
Hi All ,
I would like to know how do I make and option file as an argument on
command propmnt in python .
At present I using :
if len(sys.argv) == 3:
first = sys.argv[1]
second = sys.argv[2]
else:
print "enter the second argument"
It works well for the following comman
Hi,
On Mon, Jan 7, 2019 at 11:11 AM mousumi sahu
wrote:
>
> Dear Sir,
> I am trying to install python 2.7.10 on HPC. Python 2.6 has already been
> install on root. I do not have root authority. Please suggest me how can I
> do this.
Sorry - I replied to you directly, by accident. Take 2, with r
On Mon, 7 Jan 2019 at 11:10, mousumi sahu wrote:
>
> Dear Sir,
> I am trying to install python 2.7.10 on HPC. Python 2.6 has already been
> install on root. I do not have root authority. Please suggest me how can I
> do this.
Does HPC stand for High-Performance Computing? Are you trying to set
up
On Mon, Jan 07, 2019 at 03:36:01PM +0530, mousumi sahu wrote:
> Dear Sir,
> I am trying to install python 2.7.10 on HPC. Python 2.6 has already been
> install on root. I do not have root authority. Please suggest me how can I
> do this.
What's HPC?
If you don't have root permission, do you have p
Dear Sir,
I am trying to install python 2.7.10 on HPC. Python 2.6 has already been
install on root. I do not have root authority. Please suggest me how can I
do this.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
h
On Thu, Dec 20, 2018 at 10:49:25AM -0500, Mary Sauerland wrote:
> I want to get rid of words that are less than three characters
> f1_name = "/Users/marysauerland/Documents/file1.txt"
> #the opinions
> f2_name = "/Users/marysauerland/Documents/file2.txt"
> #the constitution
Better than comments
T', 'TEST', 'WITH.']
Since you read in all your data using the same function, you might even make
it take an optional value to cut at, defaulting with 3 or even 0.
-Original Message-
From: Tutor On Behalf Of
Mary Sauerland
Sent: Thursday, December 20, 2018 10:49
On 12/20/18 8:49 AM, Mary Sauerland wrote:
> Hi,
>
> I want to get rid of words that are less than three characters but I keep
> getting errors. I tried multiple ways but keep getting errors.
Just a quick note or two:
>
> Here is my code:
>
> f1_name = "/Users/marysauerland/Documents/file1.t
On Dec 20, 2018 12:17 PM, "Mary Sauerland" wrote:
>
> Hi,
>
> I want to get rid of words that are less than three characters but I keep
getting errors. I tried multiple ways but keep getting errors.
Hi Mary welcome to the tutor list. We love to help. We are a few
volunteers. It is very difficult
Hi,
I want to get rid of words that are less than three characters but I keep
getting errors. I tried multiple ways but keep getting errors.
Here is my code:
f1_name = "/Users/marysauerland/Documents/file1.txt"
#the opinions
f2_name = "/Users/marysauerland/Documents/file2.txt"
#the constituti
@python.org
Subject: Re: [Tutor] Python function
On 13/12/2018 17:21, Sammy Lee wrote:
> How do I create a python function that opens a CSV file and determines
> how many columns of data are in the file? The CSV files have been
> randomly generated from https://www.mockaroo.com/
On 13/12/2018 17:21, Sammy Lee wrote:
> How do I create a python function that opens a CSV file and determines how
> many columns
> of data are in the file? The CSV files have been randomly generated from
> https://www.mockaroo.com/
>
> def csv_column_count(openfile):
You will find a bunch of s
On Dec 13, 2018 1:55 PM, "Sammy Lee" wrote:
>
> How do I create a python function that opens a CSV file and determines
how many columns
> of data are in the file? The CSV files have been randomly generated from
https://www.mockaroo.com/
>
> def csv_column_count(openfile):
Same comments as I made
How do I create a python function that opens a CSV file and determines how many
columns
of data are in the file? The CSV files have been randomly generated from
https://www.mockaroo.com/
def csv_column_count(openfile):
___
Tutor maillist - Tutor@pyth
On Wed, Dec 12, 2018 at 06:57:09AM -0600, Ravi Kumar wrote:
> I know this occurs when the api response is nulls but how do I handle this?
if response is None:
handle None case
else:
handle non-None case
--
Steve
___
Tutor maillist - Tutor@
Ravi Kumar wrote:
> Hi,
>
> I have developed a python script to get api calls for meraki
> clientlogevents Thanks for all the help previously I am facing few errors
> such as
>
> Json_string=r.json()
>
> raw_decode
> raise JSONDecodeError("Expecting value", s, err.value) from None
> json.d
On 12/12/2018 12:57, Ravi Kumar wrote:
> '{0:20} {1:30} {2:16} {3:18} {4:10} {5:11} '.format(
> deviceserial, type, macaddress,occurredAt, details))
> TypeError: unsupported format string passed to NoneType.__format__
You have 6 format holders in your string but you only
pass 5 values
Hi,
I have developed a python script to get api calls for meraki
clientlogevents Thanks for all the help previously I am facing few errors
such as
Json_string=r.json()
raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value:
On 24Nov2018 16:08, Dimitar Ivanov wrote:
Your explanation definitely clears up quite a bit of my
misunderstanding,
thank you for that!
There was a reason why I shy away from using Queue, but for the life of me
I can't remember right now what that reason was. I will have to modify my
code usin
Hi Cameron,
Massive apologies for the delayed answer!
Your explanation definitely clears up quite a bit of my misunderstanding,
thank you for that!
There was a reason why I shy away from using Queue, but for the life of me
I can't remember right now what that reason was. I will have to modify my
On 19Nov2018 23:52, Dimitar Ivanov wrote:
I'm having a hard time getting my head around threads so I was hoping
someone who has better understanding of their underlying functionality
could lend me a helping hand, in particular how threads work with each
other when using thread.join() and Semapho
Hello everyone,
I'm having a hard time getting my head around threads so I was hoping
someone who has better understanding of their underlying functionality
could lend me a helping hand, in particular how threads work with each
other when using thread.join() and Semaphore set with maximum value. I
Dev,
There are many ways to learn a programming language but a list of all
commands is not necessarily a good way. I suspect your real question is how
do you learn Python as either a beginner at this language or with little
knowledge of computers in general.
There are tons of books and classes bo
On 10/25/18 5:30 PM, Mats Wichmann wrote:
On 10/25/2018 03:07 PM, Jim wrote:
Mint 18.1
Default python3 = 3.5
Python 3.6 installed for use by a virtual environment.
Update manager just informed me of an update for python 3.6 to 3.6.7-1.
When I started to install it, I got a dialog saying:
thi
On 26/10/2018 18:20, Adam Eyring wrote:
> beef = (beefmeals * 15.95)
Note that the parens here are completely redundant.
They don't break anything but neither do they
contribute anything.
WE already have LISP(*) for those who love parens,
no need for (so many of) them in Python
(*)Lots of Irrel
On Fri, Oct 26, 2018 at 3:03 PM Bob Gailer wrote:
> On Oct 26, 2018 1:20 PM, "Adam Eyring" wrote:
> >
> > Try this cleaned up version with colons in the right places, dollar
> signs removed, and other corrections:
>
> Does it do what you want?
>
> > beefmeals=int(input("Enter number of beef meal
Try this cleaned up version with colons in the right places, dollar signs
removed, and other corrections:
beefmeals=int(input("Enter number of beef meals: "))
shitmeals=int(input("Enter number of vegan meals: "))
party = beefmeals + shitmeals
print("Total meals", party)
a = 0
b = 0
c = 0
if party
On Oct 26, 2018 1:20 PM, "Adam Eyring" wrote:
>
> Try this cleaned up version with colons in the right places, dollar signs
removed, and other corrections:
Does it do what you want?
> beefmeals=int(input("Enter number of beef meals: "))
> shitmeals=int(input("Enter number of vegan meals: "))
> p
On Oct 26, 2018 6:11 AM, "Ben Placella" wrote:
>
> I need to write code that runs a cost calculating program with many
> different variables and I honestly don't understand it
Could you be more specific? What exactly don't you understand, or even
better what do you understand?
my code is:
How
On 25/10/2018 23:14, Ben Placella wrote:
Please always post code in plain text not HTML or Rich text.
Otherwise we lose all the formatting which is important in Python.
> beefmeals=int(input("Enter number of beef meals: "))
> shitmeals=int(input("Enter number of vegan meals: "))
> party=beefmeals
On Thu, Oct 25, 2018 at 06:13:31PM -0400, Ben Placella wrote:
> So I have to make a fibonacci sequence, and I'm not sure what is wrong with
> my code
[...]
> attached is a photo of what the output SHOULD look like
No it isn't. For security (anti-spam, anti-virus) reasons, this mailing
list delet
On Thu, Oct 25, 2018 at 06:14:41PM -0400, Ben Placella wrote:
> I need to write code that runs a cost calculating program with many
> different variables and I honestly don't understand it, my code is:
> beefmeals=int(input("Enter number of beef meals: "))
> shitmeals=int(input("Enter number of ve
Plain text is preferred for code since otherwise the mail
system removes all indentation making the code hard to understand.
On 25/10/2018 23:13, Ben Placella wrote:
> So I have to make a fibonacci sequence, and I'm not sure what is wrong with
> my code
> #This program illustrates the fibonacci se
nth = n1 + n
I don't see where n is defined anywhere. Should be n2?
On Fri, Oct 26, 2018 at 6:09 AM Ben Placella
wrote:
> So I have to make a fibonacci sequence, and I'm not sure what is wrong with
> my code
> #This program illustrates the fibonacci sequence
> nterms=int(input("Please enter ho
I need to write code that runs a cost calculating program with many
different variables and I honestly don't understand it, my code is:
beefmeals=int(input("Enter number of beef meals: "))
shitmeals=int(input("Enter number of vegan meals: "))
party=beefmeals+shitmeals
print(party)
if party<=50
a=7
So I have to make a fibonacci sequence, and I'm not sure what is wrong with
my code
#This program illustrates the fibonacci sequence
nterms=int(input("Please enter how many terms you would like to know: "))
n1 = 1
n2 = 1
count = 0
if nterms <= 0:
print("Please enter a positive integer")
elif nterms
On 10/25/2018 03:07 PM, Jim wrote:
> Mint 18.1
> Default python3 = 3.5
> Python 3.6 installed for use by a virtual environment.
>
>
>
> Update manager just informed me of an update for python 3.6 to 3.6.7-1.
> When I started to install it, I got a dialog saying:
>
> this upgrade will trigger ad
Mint 18.1
Default python3 = 3.5
Python 3.6 installed for use by a virtual environment.
Update manager just informed me of an update for python 3.6 to 3.6.7-1.
When I started to install it, I got a dialog saying:
this upgrade will trigger additional changes. The following 2 packages
will be
Alan Gauld via Tutor wrote:
> On 15/10/18 08:57, Peter Otten wrote:
>
>> By the way, you do not need a map (dict) at all to implement a game like
>> this, you may return the next scene directly. A sketch:
>>
>> class Bridge:
>> def enter(self):
>> ...
>> action = ...
>>
On 15/10/18 08:57, Peter Otten wrote:
> By the way, you do not need a map (dict) at all to implement a game like
> this, you may return the next scene directly. A sketch:
>
> class Bridge:
> def enter(self):
> ...
> action = ...
> if action == "jump off the bridge":
>
bob gailer wrote:
> Python coding "trick"1
> when I build a map I omit the () after the class e.g. 'death' = Death,
> ... and apply them to the item retrieved from the map.
>
> use a decorator to build the map dictionary:
>
> # the decorator function:
> def add_to_ma
More comments on code:
guess = raw_input("[pod #]> ")
if int(guess) != good_pod:
If user enters something that will not convert to integer an exception
will be raised. For example
>>> int('a')
Traceback (most recent call last):
File "", line 1, in
ValueError: invalid literal
On 10/14/2018 1:42 PM, Mats Wichmann wrote:
Hint here: don't use 'map' as your own variable name, since it's a
built-in function.
Absolutely, I am always warning others about this gotcha. In this case
map is local to add_to_map so it does not affect then global namespace.
The reason I used it
On 10/14/2018 10:08 AM, bob gailer wrote:
> Python coding "trick"1
> when I build a map I omit the () after the class e.g. 'death' = Death,
> ... and apply them to the item retrieved from the map.
>
> use a decorator to build the map dictionary:
>
> # the decorator fun
More comments:
User Friendly?
I hope this game is not intended for actual use. No one will be able to
guess the correct actions in a reasonable time. or 3 digit random code
given 10 tries for any one code. I for one would give up pretty quickly.
The original colossal
1 - 100 of 3660 matches
Mail list logo