On 13/08/2019 12:09, Sithembewena L. Dube wrote:
> Hi Marissa,
>
> I really think that you could consider doing an introductory Python
> tutorial and then venture back into solving this problem.
>>> This is the output of my updated code:
>>> Traceback (most recent call last):
>>> File
Hi Marissa,
I really think that you could consider doing an introductory Python
tutorial and then venture back into solving this problem.
Understanding concepts like data types, function syntax and loops makes all
the difference in approaching programming challenges.
Here is a decent and free
On 12Aug2019 15:11, Marissa Russo wrote:
This is my code:
Thank you.
This is the output of my updated code:
Traceback (most recent call last):
File "/Applications/Python 3.7/exercises .py", line 37, in
main()
File "/Applications/Python 3.7/exercises .py", line 33, in main
m =
On 13/08/19 7:11 AM, Marissa Russo wrote:
This is my code:
import math
def get_numbers():
print("This program will compute the mean and standard deviation")
file1 = input("Please enter the first filename: ")
file2 = input("Please enter the second filename: ")
x =
This is my code:
import math
def get_numbers():
print("This program will compute the mean and standard deviation")
file1 = input("Please enter the first filename: ")
file2 = input("Please enter the second filename: ")
x = open(file1, "r")
y = open(file2, "r")
nums =
On 8/12/19 10:54 AM, Marissa Russo wrote:
> Hello,
>
> I am trying to figure out what is going on and why my output is saying
> “” instead of giving me a number. Please let me know if
> you see the error in my code!!
to quickly illustrate the specific question you asked - you got comments
on
On 12/08/2019 17:54, Marissa Russo wrote:
> def mean(nums):
> for num in nums:
> _sum += num
> return _sum / len(nums)
>
> def mean2(nums2):
> for num in nums2:
> _sum += nums2
> return _sum / len(nums2)
>
> def main():
> data = get_numbers()
>
>
In your calls to the `*print*` function, you are not calling the `*mean*`
and `*mean2*` functions that you declared to calculate averages. So Python
sees you trying to concatenate two function objects to strings and is not
happy. That's one thing.
Secondly, your code could be refactored to
On Mon, Aug 12, 2019 at 1:22 PM Marissa Russo wrote:
>
> Hello,
>
> I am trying to figure out what is going on and why my output is saying
> “” instead of giving me a number. Please let me know if
> you see the error in my code!!
>
Marissa, you have lots of problems here. First, you should
On 4/29/19 1:44 AM, Alan Gauld via Tutor wrote:
> On 28/04/2019 17:11, Dr. Luca T wrote:
> ^
>> SyntaxError: Missing parentheses in call to 'print'. Did you mean
>> print("Unit tests have failed!")?
>>
>
>> I use windows
On 28/04/2019 17:11, Dr. Luca T wrote:
^
> SyntaxError: Missing parentheses in call to 'print'. Did you mean
> print("Unit tests have failed!")?
>
> I use windows 10, python 3.7.3 ...
The problem is you are running python
Dr. Luca T wrote:
> Hi,
> i'm new in python, i tried to install beautifulsoup but i had back this
> error:
>
> ERROR: Complete output from command python setup.py egg_info:
> ERROR: Traceback (most recent call last):
> File "", line 1, in
> File
>
On 25/04/2019 11:54, Mark Alderson wrote:
> tried screen.colormode(255)
Peter has shown you how to make that work but
there is a wee issue below I need to point out.
> -code-
> from turtle import Turtle
> t = Turtle()
> t.speed(0)
>
> b = 180
Mark Alderson wrote:
> hi
>
> Ihave a very small program. I want to cycle colours. I cant set the
> colormode from 1 to 255
>
> tried screen.colormode(255)
>
> tells me screen is not defined. the program works without the colormode,
> but i want to use it.
>
> I just change the a and b
Hi Peter,
Thanks soo much ...Its solved...have a nice day !
On Wed, 17 Apr 2019 at 22:48, Peter Otten <__pete...@web.de> wrote:
> fatima butt wrote:
>
> > hi Peter,
> > hope you are well.I am getting the following error when i am running the
> > pygame shell script.I am using Acer SWIFT
fatima butt wrote:
> hi Peter,
> hope you are well.I am getting the following error when i am running the
> pygame shell script.I am using Acer SWIFT computer.my python version is
> 3.7.3 and pygame version is pygame 1.9.5
>
> Traceback (most recent call last):
> File
On 28/03/2019 21:12, lucasbreault2...@gmail.com wrote:
> I’m trying to make a password that must contain a number in it.
I assume you mean you want to check whether a password
has a number in it? Does it need to be a single digit
or can there be multiple?
> Which method do I use for that?
On 20/03/19 14:30, Eric Oh Yeah Yeah wrote:
How do I make Python 3 pick a random variable out of a set of variables I
give it?
There are several options but if you look in the random module you
should find one that suits your particular needs.
choice() or randrange() may be good options.
Mario,
On 21/02/19 3:30 AM, Mario Ontiveros wrote:
Hello,
I am new to python and have been stuck on this for a while. What I am
trying to do is to remove rows with void, disconnected, and error on lines. The
code I have does that, the only problem is that it removes my header because
On 2019-02-20 06:30, Mario Ontiveros wrote:
Hello,
I am new to python and have been stuck on this for a while. What I
am trying to do is to remove rows with void, disconnected, and error
on lines. The code I have does that, the only problem is that it
removes my header because void is in
On 20/02/2019 14:30, Mario Ontiveros wrote:
> Hello,
> I am new to python and have been stuck on this for a while. What I am
> trying to do is to remove rows with void, disconnected, and error on lines.
> The code I have does that, the only problem is that it removes my header
> because
On 20/02/2019 14:30, Mario Ontiveros wrote:
Hello,
I am new to python and have been stuck on this for a while. What I am
trying to do is to remove rows with void, disconnected, and error on lines. The
code I have does that, the only problem is that it removes my header because
void is in
On 05/02/2019 14:15, Peter Otten wrote:
>> Error:
>> ./python2.py: line 1: syntax error near unexpected token `('
>
> That is not a Python error, that's a complaint of your shell.
Oh, good catch Peter.
I never noticed the start of the line I just read the text and saw the
weird backtick...
--
>> Error:
>> ./python2.py: line 1: syntax error near unexpected token `('
>
> That is not a Python error, that's a complaint of your shell.
> If you make a Python script executable you also have to insert the proper
> hash-bang line. In the case of Python 2
>
> #!/usr/bin/python2
>
> will
Sonia Miglani wrote:
> Hi Team,
>
> I am learning puthon and trying the following code.
>
> But getting the following error.
>
> Please help me in knowing the code in better way.
>
>
> OS Linux
> Python version 2.7.13
>
>
>
> def demo(s, exclaim):
> #"""
> # Returns the string 's'
On 05/02/2019 12:32, Sonia Miglani wrote:
> OS Linux
> Python version 2.7.13
Can you tell us how you are creating the file?
Which editor are you using? It looks like there may be
some spurious characters in your file.
> def demo(s, exclaim):
> #"""
> # Returns the string 's' repeated 3
On 12/10/18 04:31, Adam Eyring wrote:
> Also, it looks better to use " + " instead of a comma:
> print("Combining these foods will you," + new_food)
It may "look better" but be aware that they don't do
the same thing and the plus sign is a lot less efficient
computationally since it creates a
On 12/10/18 04:31, Adam Eyring wrote:
The program works as is in Python3. For Python2, change input to raw_input
and see if that makes it work (I know it worked for me when I had Python2).
Also, it looks better to use " + " instead of a comma:
print("Combining these foods will you," + new_food)
The program works as is in Python3. For Python2, change input to raw_input
and see if that makes it work (I know it worked for me when I had Python2).
Also, it looks better to use " + " instead of a comma:
print("Combining these foods will you," + new_food)
Also, colons and spaces are good
https://www.w3schools.com/python/ref_func_input.asp
tor. 11. okt. 2018 18.51 skrev Carlton Banks :
> What are you trying to do?
>
> tor. 11. okt. 2018 18.33 skrev Holly Jo :
>
>>
>> I have no clue what I’m doing wrong, I’m a new student
>>
>> food_1=input("Sushi")
>> food_2=input("Quesdilla")
>>
What are you trying to do?
tor. 11. okt. 2018 18.33 skrev Holly Jo :
>
> I have no clue what I’m doing wrong, I’m a new student
>
> food_1=input("Sushi")
> food_2=input("Quesdilla")
> new_food=food_1+food_2
> print("Combining these foods will you,",new_food)
> input("Press enter to continue")
>
On 11/10/18 04:19, Holly Jo wrote:
>
> I have no clue what I’m doing wrong, I’m a new student
>
> food_1=input("Sushi")
> food_2=input("Quesdilla")
> new_food=food_1+food_2
> print("Combining these foods will you,",new_food)
> input("Press enter to continue")
Please always tell us what has
You are using the same variable name twice.
You may use "rivers" for the dict and "river" for values.
Also use descriptive names for variables. For eg if you correct the above
mistake, the next one will be this line
for rivers in rivers.values():
print (rivers)
and sorry for top positing.
On Wed, Oct 10, 2018, 12:37 PM Michael Schmitt
wrote:
> To whom it may concern:
>
>
> I am trying to teach myself Python and ran into a problem. This is my code
>
>
> # name of rivers and country
>
> rivers = {'nile' : 'egypt', 'ohio' : 'US', 'rhine' : 'germany' }
>
> # prints river name
> for
i think it should have been
for river in rivers instead of
for rivers in rivers
Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
Mauritius
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
Michael Schmitt wrote:
> To whom it may concern:
>
>
> I am trying to teach myself Python and ran into a problem. This is my code
> I am getting the following error
> for rivers in rivers.values():
> AttributeError: 'str' object has no attribute 'values'
> # prints river name
> for rivers in
On 13Sep2018 08:23, Ryan Smith wrote:
[...] I'm still getting familiar with all of the
different encodings at play. For example the way I currently
understand things is that python supports unicode which ultimately
defaults to being encoded in UTF-8. Hence I'm guessing is the reason
for
Hi Peter,
Thank you for the explanation! I have been banging my head around this
for almost two days. I'm still getting familiar with all of the
different encodings at play. For example the way I currently
understand things is that python supports unicode which ultimately
defaults to being
Ryan Smith wrote:
> Hello All,
>
> I am currently working on a small utility that finds any base64
> encoded strings in files and decodes them. I am having issue
> understanding how the Base64 module actually works. The regular
> expression that I am using correctly matches on the encoded
Chip Wachob wrote:
> Peter,
>
> I see that clue "[[".
>
> The thread history pretty much sums up what is going on up to this point.
>
> I'll cover it once more:
[snip]
> I hope this helps.
Unfortunately it doesn't as the problem is in my_transfer.
> I'm beginning to wonder if Python was
On 10/09/18 19:15, Chip Wachob wrote:
> So I see why my .join() isn't working. I'm not sure how to fix it though.
I already showed you the sum() function.
It can take a list of lists and add them together
end_array = sum(results,[])
> My background is in C and other 'historical' languages,
On 10Sep2018 10:23, Chip Wachob wrote:
So, without all the fluff associated with wiggling lines, my function
now looks like this:
def RSI_size_the_loop():
results = []
all_together = [] # not certain if I need this, put it in in an
attempt to fix the incompatibility if it existed
You
Peter,
I see that clue "[[".
The thread history pretty much sums up what is going on up to this point.
I'll cover it once more:
I'm using Adafruit FT232H Breakout board and Adafruit's library.
https://github.com/adafruit/Adafruit_Python_GPIO
Per Adafruit's example code, I create an SPI
Chip Wachob wrote:
> Cameron,
>
> Thank you again for the insight.
>
> Yes, data_out is an equivalently-sized 'chunk' of a larger array.
>
> I'm 'getting' this now..
>
> So, without all the fluff associated with wiggling lines, my function
> now looks like this:
>
> def RSI_size_the_loop():
Cameron,
Thank you again for the insight.
Yes, data_out is an equivalently-sized 'chunk' of a larger array.
I'm 'getting' this now..
So, without all the fluff associated with wiggling lines, my function
now looks like this:
def RSI_size_the_loop():
results = []
all_together = [] # not
On 10/09/18 04:00, Chip Wachob wrote:
> I presume that I need to instantiate an array of slice_size-sized bytearrays.
Cameron has already addressed this and explained
that you don't need to and if you did how to do it.
I'd only add that you need to readjust your thinking
when it comes to Python
On 09Sep2018 23:00, Chip Wachob wrote:
On Sat, Sep 8, 2018 at 9:14 PM, Cameron Simpson wrote:
Actually he's getting back bytearray instances from transfer and wants to
join them up (his function does a few small transfers to work around an
issue with one big transfer). His earlier code is
On Sat, Sep 8, 2018 at 9:14 PM, Cameron Simpson wrote:
> On 08Sep2018 11:40, Alan Gauld wrote:
>>
>> On 08/09/18 03:15, Chip Wachob wrote:
>>>
>>> Ideally, I'd like to take the slice_size chunks that have been read
>>> and concatenate them back togetjer into a long MAX_LOOP_COUNT size
>>> array
On 09Sep2018 17:06, Chip Wachob wrote:
Before I jump in, the 1000 foot view is I have to send an array of 512
bytes down the SPI loop, and read back 512 bytes that were latched in
from a control interface. Unfortunately, there's a glitch in the FTDI
part and I can't just send the 512 bytes..
Cameron, et al.
First off, thank you for being patient with me. I'm not used to the
email list communication style.
Since Cameron's response was the one that raised the most questions /
comments, I'm going to reply to it.
Inline.. now that I know that this is the preferred method...
Before I
On 08Sep2018 11:40, Alan Gauld wrote:
On 08/09/18 03:15, Chip Wachob wrote:
Ideally, I'd like to take the slice_size chunks that have been read
and concatenate them back togetjer into a long MAX_LOOP_COUNT size
array to pass back to the rest of my code. Eg:
You need to create a list of
On 08Sep2018 20:01, Cameron Simpson wrote:
So, if I'm understanding the transfer() function correctly, the
function takes and returns a bytearray type.
It would be good to see the specification for the transfer function.
They we can adhere to its requirements. Can you supply a URL?
I see
On 08/09/18 03:15, Chip Wachob wrote:
> my function's main pieces are:
It would probably be better to post the entire function,
a partial code sample like this just gives us an inkling
of what you are trying to do but not enough to be sure
of where the errors lie.
> def transfer_byte_array():
>
On 08/09/18 03:15, Chip Wachob wrote:
> Admin, please remove my earlier messages.
No can do, once the emails are sent by the server
they are out there on the net, stored in people's
mailboxes and in various internet archives.
When using a mailing list always check before
sending, there's no
On 08/09/18 04:57, Chip Wachob wrote:
> was my attempt at 'setting' the type of the variable.
A variable in Python is just a name. It has no type.
Only values have types. So you can set (or change)
the type of a value but not of a variable.
> Coming from a 'C' background, I find the lack of
Please try to adopt the inline reply style; we prefer it here. It lets us reply
point by point and makes messages read like conversations. Anyway...
On 07Sep2018 23:57, Chip Wachob wrote:
Point taken on 'bytes'.. thanks.
the
scratch_ary = bytearray()
was my attempt at 'setting' the type of
Point taken on 'bytes'.. thanks.
the
scratch_ary = bytearray()
was my attempt at 'setting' the type of the variable. I had hoped
that it would help resolve the error messages telling me that the
types didn't go together.
Coming from a 'C' background, I find the lack of typing in Python to
be
On 07Sep2018 15:45, Chip Wachob wrote:
Basically I'm trying to write a block of unsigned bytes to the device
and read back an equal sized block of unsigned bytes. There's a
function that is provided called transfer(data_to_send, num_of_bytes)
that handles the heavy lifting. Unfortunately
Hi Crystal, and welcome! My response is further below, after your
question.
On Mon, Jul 16, 2018 at 05:28:37PM -0500, Crystal Frommert wrote:
> Hi, I am a beginner comp sci teacher at an all-girls high school. The girls
> are learning how to read from a txt file and search for a string.
>
>
On 16/07/18 23:28, Crystal Frommert wrote:
> are learning how to read from a txt file and search for a string.
>
> Here is a sample of text from the txt file:
> TX,F,1910,Mary,895
> TX,F,1910,Ruby,314
> TX,F,1910,Annie,277
>
> How do they read the number after a certain searched name and then
On 03/07/18 06:23, Adam Jones wrote:
> Good day, I am currently checking a piece of arcpy code. Where a point is
> shifted within a set distance to protect the privacy of said point. Please
> see the code below, and please advise me or correct the code where it is
> needed
It would help us to
On 22/05/18 18:13, Glenn Schultz wrote:
Cavbeat: I'm no dataframe expert so I'm going on
general principles here...
> I am trying to apply the function to the data frame as follows:
>
> df['loanage'].apply(myfunction(x = 2, y = 10, z = 10, df['loanage]), axis = 0)
This looks wrong on several
On 16/05/18 02:43, Steven D'Aprano wrote:
> The traceback Sam posted says (in part):
>
> Move = input('What Will You Do? Fight or Run: ')
> File "", line 1, in
> NameError: name 'Run' is not defined
>
> so the failed line was the call to input(). In Python 3, it would return
> a string.
On Tue, May 15, 2018 at 08:01:13PM -0500, boB Stepp wrote:
> On Tue, May 15, 2018 at 7:51 PM, Steven D'Aprano wrote:
>
> > You also seem to be using Python 2. In Python 2, you should never use
> > the input() function. Instead, use raw_input() instead.
>
> What are you
On Tue, May 15, 2018 at 7:51 PM, Steven D'Aprano wrote:
> You also seem to be using Python 2. In Python 2, you should never use
> the input() function. Instead, use raw_input() instead.
What are you seeing that suggests the OP is using Python 2? I am
missing what you are
On Tue, May 15, 2018 at 02:49:54PM -0500, Sam Hoffman wrote:
> Traceback (most recent call last):
> File "/Users/samhoffman/Documents/test.py", line 54, in
> Battle()
> File "/Users/samhoffman/Documents/test.py", line 41, in Battle
> Move = input('What Will You Do? Fight or Run: ')
>
Greetings!
On Tue, May 15, 2018 at 2:49 PM, Sam Hoffman
wrote:
> Traceback (most recent call last):
> File "/Users/samhoffman/Documents/test.py", line 54, in
> Battle()
> File "/Users/samhoffman/Documents/test.py", line 41, in Battle
> Move = input('What
Hi Shannon,
Yes there is a way. First in my opinion I think queue.json is not really a JSON
data structure but just a list of list. If you are able to read it then I
that’s great.
One way to solve this is doing something like below:
queue = [
["James Bruce", "Bananas"],
On 30/04/18 14:35, Shannon Evans via Tutor wrote:
> Hi, is there any way that i can add a loop or iteration or something so
> that i dont have to write out every person who has fruit.
Yes that's what loops are for.
You have two options in Python: a 'for' loop or a 'while' loop
In your case I
On 2018-04-19, Steven D'Aprano wrote:
> Some program ideas...
>
> Encrypt and decrypt text using a Caesar Cipher.
>
> https://en.wikipedia.org/wiki/Caesar_cipher
>
> or one of many other simple ciphers.
>
> Calculate the prime numbers up to a certain limit.
>
>
Hello Joshua, and welcome!
My comments below.
On Thu, Apr 19, 2018 at 01:15:59AM +, Joshua Nghe wrote:
> Hi,
> This is Joshua N from Campus Middle School.
You are talking to people from all over the world, and some of us are
not familiar with what you mean by "Middle School". What is it?
On 12/04/18 11:54, Aditya Mukherjee wrote:
> Hello, I'm relatively new to python and have been given a task for
> university, and would greatly appreciate if anyone could help me basically
> just get started because as of now I am completely clueless and have no
> idea what to do. I don't really
> On Apr 12, 2018, at 05:54, Aditya Mukherjee
> wrote:
>
> Helping me getting started and just understanding what I actually need to
> do would be vastly helpful, as I've heard from other students that they
> have over 200 lines. :)
>
> I've attached the premise
print 30 * "-" , "MENU" , 30 * "-"
# just tested in py3 you can do
# 'MENU'.center(67, '-')
On Sun, Mar 11, 2018 at 8:20 AM, Leslie SimondeMontfort via Tutor <
tutor@python.org> wrote:
> Hi, I wondered if there is someone that can help me with this code. Thank
> you, Leslie
>
> ## Text menu
On Mar 11, 2018 6:25 AM, "Leslie SimondeMontfort via Tutor" <
tutor@python.org> wrote:
>
> Hi, I wondered if there is someone that can help me with this code.
I have to assume that you are very new to python. Have you written a Python
program that runs the way you want it to?
It is often useful
On 10Mar2018 23:20, Leslie SimondeMontfort wrote:
Hi, I wondered if there is someone that can help me with this code. Thank you,
Leslie
Generally we like to know what you think is wrong with it. For example, what
you expected it to do, and a little transcript of what it
On 11/03/18 04:20, Leslie SimondeMontfort via Tutor wrote:
> Hi, I wondered if there is someone that can help me with this code.
I'll try but theres a lot to comment on.
See below...
> def print_menu(): ## Your menu design here
> print 30 * "-" , "MENU" , 30 * "-"
> print "1. Menu
On Sat, Mar 10, 2018 at 11:20 PM, Leslie SimondeMontfort via Tutor <
tutor@python.org> wrote:
> Hi, I wondered if there is someone that can help me with this code. Thank
> you, Leslie
>
> ## Text menu in Python
>
> def print_menu(): ## Your menu design here
> print 30 * "-" , "MENU" ,
cm wrote:
> Dear tutors,
>
> I have written below function to open the profanity check url and then
> to check for profanity in some text. When I go to the url
> http://www.wdylike.appspot.com/?q= and type in the same text, it works
> fine.
>
> I am using Microsoft OS X and Python 3.5.2
Thanks for the tip!
On Feb 7, 2018 18:49, "Rex" wrote:
> I think you need to convert the input value to an integer with
> int(variable_name)
>
>
>
> Sent from my iPhone
>
> > On Feb 7, 2018, at 4:34 PM, Frank Dominguez
> wrote:
> >
> > greetings,
>
I think you need to convert the input value to an integer with
int(variable_name)
Sent from my iPhone
> On Feb 7, 2018, at 4:34 PM, Frank Dominguez wrote:
>
> greetings,
> this is my first time using python and i just cannot figure out what I am
> doing wrong im
On 07/02/18 21:34, Frank Dominguez wrote:
> this is my first time using python and i just cannot figure out what I am
> doing wrong im sure the answer is very simple but sadly i do not know what
Please always include full error messages in your mail
- don't assume we will willingly run buggy
On 03/02/18 02:12, JSelby wrote:
>My 8 year old is reading Python for kids and is trying a few programs
>from the book We are working on a Mac OS X ELCapitain. We are looking at
>WHACK THE BOUNCING BALL.
>He has copied the code below and we get the red error message below.
Sorry can't see any error messages through the visible links.
On 3 Feb. 2018, 7:08 pm, at 7:08 pm, JSelby wrote:
> My 8 year old is reading Python for kids and is trying a few programs
>from the book We are working on a Mac OS X ELCapitain. We are looking
>at
> WHACK THE
On 01/11/17 06:02, Hemant Sain wrote:
> i want to tag categories to its menuname.
Your description below does not explain how you will
tag them together, you simply identify which menu
items have a category, but no way to determine
which category goes with which menu item?
> i have a csv
This is a mailing list, so the best way to get help is to send a request
with code examples and most importantly what you have already tried. That
being said, there are some smart people on here, much more experienced than
I am on Python so I would say you can get help with any problem you may
On 30/10/17 21:02, Alchemy wrote:
> I’m stuck on the homework ,butmore importantly stuck on the concepts behind
> the homework.
>
> Can your orginazation help?
Yes, we are happy to help with homework although we won't
usually give you the full answer. We will make suggestions
and are happy to
On 27/09/2017 20:36, Derry, James R wrote:
[Top posting fixed]
From: Tutor [tutor-bounces+jderry=mail.utexas@python.org] on behalf of
edmundo pierre via Tutor [tutor@python.org]
Sent: Wednesday, September 27, 2017 8:10 AM
To: Tutor Python
On 27/09/2017 14:10, edmundo pierre via Tutor wrote:
Hello,
When I used sort() to do that, but my problem is that sort() just arrange
numbers from small to big, not from big to small. That is the issue I am having
now. For instance:
# The user is entering those numbers:a = 2.7b = 4.7c= 5.8d =
In [2]: ?sorted
Signature: sorted(iterable, /, *, key=None, reverse=False)
Docstring:
Return a new list containing all items from the iterable in ascending order.
A custom key function can be supplied to customize the sort order, and the
reverse flag can be set to request the result in descending
edmundo pierre via Tutor schreef op 27/09/2017 15:10:
Hello,
When I used sort() to do that, but my problem is that sort() just arrange
numbers from small to big, not from big to small. That is the issue I am having
now. For instance:
# The user is entering those numbers:a = 2.7b = 4.7c= 5.8d =
besides already written notes,
i suggest
use .split(".")
floatNum = input("> ")
parts = floatNum.split(".")
whole = parts[0]
deci = parts[1]
Abdur-Rahmaan Janhangeer,
Mauritius
abdurrahmaanjanhangeer.wordpress.com
On 7 Sep 2017 21:51, "edmundo pierre via Tutor" wrote:
>
Greetings Edmundo!
On Thu, Sep 7, 2017 at 1:35 PM, Peter Otten <__pete...@web.de> wrote:
> edmundo pierre via Tutor wrote:
>
>>
>> I am trying to write a code that asks an User to Enter a decimal number,
>> the my program should separate the number in two parts like this: 1
>> cae:Enter a number:
On 09/07/2017 10:20 AM, edmundo pierre via Tutor wrote:
>
> I am trying to write a code that asks an User to Enter a decimal number, the
> my program should separate the number in two parts like this:
> 1 cae:Enter a number: 12.9Decimal part: 12whole part : 9
> 2 case:Enter: 10Decimal par:Whole
edmundo pierre via Tutor wrote:
>
> I am trying to write a code that asks an User to Enter a decimal number,
> the my program should separate the number in two parts like this: 1
> cae:Enter a number: 12.9Decimal part: 12whole part : 9 2 case:Enter:
> 10Decimal par:Whole part: 10 That is my
On 6 September 2017 at 08:39, edmundo pierre via Tutor wrote:
> Hi Python,
> I am trying to make a french to English dictionary. First of all, I made a
> dictionary with keys and values. Then I asked the user to enter a letter. If
> the letter correspond to the Keys, my print
On 05/09/17 19:25, Ruth Hardy wrote:
> I was wondering if you can help me please with these computer science tasks
We can help, but we won;t do them for you.
> First Task
>
> Write code do the following things involving strings. Wherever possible,
> you should try to incorporate
On 19Aug2017 06:13, kay Cee wrote:
update_log = open('update_log.txt', 'r+')
Normally one would use 'a' (append) for a log open. I don't see what 'r+'
accomplishes for you. In particular I expect it would always write at the start
of the log file, overwriting
On 19/08/17 11:13, kay Cee wrote:
> import subprocess
> import time
> import datetime
>
> class UpdateError(Exception):
> pass
In defining your own type of Exception you implicitly
say that you will be raising it somewhere. But you
never raise this exception in your code...
> def update():
On 08/19/2017 04:13 AM, kay Cee wrote:
> I made a python script that will update a Ubuntu Server every second and
> writes asuccess message and date to a log file, but for some reason the
> file is not being written to.
>
> Here is the Script:
>
> #!/usr/bin/python3
>
> import subprocess
>
1 - 100 of 1500 matches
Mail list logo