[Tutor] Help with a task

2018-04-12 Thread Aditya Mukherjee
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 know who to ask, but anything would be of
assistance.


I feel like I understand the basics of functions such as lists,
if/elif etc. but can't really comprehend what to do with anything involving
more than the use of simple functions.


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 of what the task is asking for, due in 2 days.


Thank you in advance


Aditya Mukherjee.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help with a task

2018-04-12 Thread David Rock

> 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 of what the task is asking for, due in 2 days.

This list does not support attachments, so we can’t see what your requirements 
are.

Also, we won’t do the work for you, so you need to help us help you by telling 
us what you have tried so far.  We can give guidance, but only if we can see 
where you have tried to go.

I would also recommend talking to your classmates that are having more success 
as a first attempt to get some direction.  2 days is not much time for a 
mailing list to help you understand an unknown assignment.


— 
David Rock
da...@graniteweb.com




___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help with a task

2018-04-12 Thread Alan Gauld via Tutor
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 know who to ask, but anything would be of
> assistance.

OK, First you need to tell us what the problem is, and as this
is a text based email service non-text attachments get stripped
by the server. You need to send a new mail explaining the problem,
what you have tried, or think you should try.

If you have any code, even if it doesn't work send it. That
way we can clearly see where you are getting things wrong
or are mis-understanding how things work. From your comments
below it is obvious that you have not fully grasped the meaning
of much of the programming jargon and terminology. Getting these
details right helps discuss solutions without confusion arising.

> I feel like I understand the basics of functions such as lists,
> if/elif etc. 

These are not functions. Lists are data structures and if/else
are control structures. Functions are something entirely different
(and possibly you haven't covered them yet).

> but can't really comprehend what to do with anything involving
> more than the use of simple functions.

Can you write a description in English (or your native tongue
if not English) of what you want the computer to do to solve
the problem? You need to understand how you would do it, without
a computer, to be able to make the computer do it for you.

If you can do that include it as requested above.

> 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. :)

1 good line is often better than 100 bad lines. Don't worry about
volume, worry about results.

> I've attached the premise of what the task is asking for, due in 2 days.

We can't see the attachment, just send us the description in
text (or a URL link if that's easier). And 2 days is maybe too
late for this one - remember email can take 24 hours to be
delivered, so by the time everyone receives/reads/responds
and you get the answer 2 days could be up!

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Json files

2018-04-12 Thread Shannon Evans via Tutor
Hi,
I have managed to get my two json files that need to be imported into
python and then i need to write a program on who gets fruit and who doesn't
and then need to get the final stock at the end. I was just wondering how i
import the files into python and how i use them after that?

[

  ["James Bruce", "Bananas"],

  ["Katherine Newton", "Bananas"],

  ["Deborah Garcia", "Pears"],

  ["Marguerite Kozlowski", "Pineapples"],

  ["Kenneth Fitzgerald", "Pineapples"],

  ["Ronald Crawford", "Bananas"],

  ["Donald Haar", "Apples"],

  ["Al Whittenberg", "Bananas"],

  ["Max Bergevin", "Bananas"],

  ["Carlos Doby", "Pears"],

  ["Barry Hayes", "Pineapples"],

  ["Donald Haar", "Bananas"]

]
this is one of them

{

"Apples": 14,

"Bananas": 14,

"Pineapples": 0,

"Pears": 8

}
and this another.
Thanks
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Json files

2018-04-12 Thread Mats Wichmann
On 04/12/2018 10:44 AM, Shannon Evans via Tutor wrote:
> Hi,
> I have managed to get my two json files that need to be imported into
> python and then i need to write a program on who gets fruit and who doesn't
> and then need to get the final stock at the end. I was just wondering how i
> import the files into python and how i use them after that?

You should start by looking at the json encoder/decoder, part of the
standard Python library:

https://docs.python.org/3/library/json.html


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Json files

2018-04-12 Thread Alan Gauld via Tutor
On 12/04/18 17:44, Shannon Evans via Tutor wrote:
> Hi,
> I have managed to get my two json files that need to be imported into
> python and then i need to write a program on who gets fruit and who doesn't
> and then need to get the final stock at the end. I was just wondering how i
> import the files into python and how i use them after that?

Do you know how to read standard text files?
And are you comfortable with dictionaries?

If so the json module documentation should
be easy to understand

Have a look and come back with any specific
questions.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] PLEASE HELP

2018-04-12 Thread Scharrer, Brianna
Applications of basic language syntax

Date/time string parsing


Time stamps on data are often recorded in the standard ISO date and time format 
as shown below

-mm-ddThh:mm:ss

2018-01-02T18:31:16 > 6:31pm on January 2, 2018

1999-02-14T21:02:37 > 9:02pm on February 14, 1999


Write code that when given a datetime string and outputs a human readable 
version exactly in the format specified below.

[Morning, Noon, Afternoon, Evening, or Night], X:XX[am or pm] on [Month as a 
word] [day], [year]

E.g. 1999-02-14T21:02:37 would be “Night, 9:02pm on February 14, 1999”

Do not use any datetime string function, though depending on your language they 
would be useful to do this in practice.

Hint: you’ll have to cast strings to integers in order to perform the if 
statements which place [Morning, Noon…], [am or pm] and [Month as a word] 
appropriately.


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] PLEASE HELP

2018-04-12 Thread Alan Gauld via Tutor
On 12/04/18 18:24, Scharrer, Brianna wrote:

What appears below seems to be an assignment of some kind.
We do not do your work for you although we will offer help.
But it is best if you show us your work so far, or at
least describe how you intend to tackle it.

In this case you are being given a string and need to
convert it to a different format. It is not clear how
you should expect to "be given" the input data but
I assume you can read it from a user?

In Python you have many string methods to help you
slice/split the input into its parts. Look at the slice
operations and the split method. Given the fixed
lengths involved here slicing is probably easiest.

The assignment suggests "casting" the string to integers
but I think this is poor terminology and what is meant
is that you should convert the substrings into integers
(casting and conversion are very different things!).

Get back to us when you have something to show us or
a specific query.

> Applications of basic language syntax
> 
> Date/time string parsing
> 
> Time stamps on data are often recorded in the standard ISO date and time 
> format as shown below
> 
> -mm-ddThh:mm:ss
> 
> 2018-01-02T18:31:16 > 6:31pm on January 2, 2018
> 
> 1999-02-14T21:02:37 > 9:02pm on February 14, 1999
> 
> 
> Write code that when given a datetime string and outputs a human readable 
> version exactly in the format specified below.
> 
> [Morning, Noon, Afternoon, Evening, or Night], X:XX[am or pm] on [Month as a 
> word] [day], [year]
> 
> E.g. 1999-02-14T21:02:37 would be “Night, 9:02pm on February 14, 1999”
> 
> Do not use any datetime string function, though depending on your language 
> they would be useful to do this in practice.
> 
> Hint: you’ll have to cast strings to integers in order to perform the if 
> statements which place [Morning, Noon…], [am or pm] and [Month as a word] 
> appropriately.



-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor