last day (15 days later) » 

13:14
Hello?
Continue
kan
kan
Hello.
Ok. Thanks @jokerdino, thanks also to you @kan
room topic changed to Coursera between kan and Mochan: Does it matter [[jokerdino]]
@Mochan np
13:17
ping me if needed
will do.
kan
kan
Can you link me to a1 handout?
Sure.
kan
kan
OK.... also, which step you're done?
kan
kan
13:19
Great!
kan
kan
so, we have to write a function: get_hours right?
Yes ~
kan
kan
return to_24_hour_clock(sec_elapsed // 3600) -- what does this do? (My sec_elapsed is the number of seconds elapsed since midnight.)
It returns the time with 3600 seconds added onto it in 24-hour time to the caller?
Wait.
Numbers of seconds elapsed then divided by 3600 and rounded off to an integer v
kan
kan
13:24
(Recall: the function to_24_hour_clock is already defined in the starter code.)
Right. Oh yeah, sorry
kan
kan
@Mochan firstly, sec_elapsed // 3600 is the number of hours passed since mid-night.
Oh! Got it
kan
kan
In an example, I gave, in the other room, this number was 30, which is weird. So, we send it to the to_24_hour_clock, which basically makes it a number satisfying the preconditions.
So, this function returns the number of hours since midnight!!!!
But 30 hours is over one day. So it would be like 1 day and six hours.
So... 6hours over midnight?
kan
kan
13:28
@Mochan but, on the clock, you'll see only 6, right?
@Mochan yes...
So... That's the answer. Now I have to figure out how to do that, right?
kan
kan
No, I just gave you a function that works!!!!
The function I gave you is the get_hours function.
Oh!
kan
kan
I hope I am not confusing!!
No, not at all ^^
13:32
keep going guys. good luck
So... For sec_elapsed, I must make a variable?
kan
kan
@Mochan yes...that should be the parameter for the function get_hours.
Thanks jokerdino ^~^
kan
kan
@jokerdino Thanks, jd. :)
13:33
Right... So... I don't have to add it myself?
i be the moral support
Ty
Wait no...
kan
kan
     no, it is a part of the header: You'll have to write some thing like:

def get_hours(sec_elapsed):
Yeah! I thought that! Thanks!
kan
kan
When you're done with this function, please ping me... @Mochan
13:38
So... Lets see...
Def get_hours(sec_elapsed):
'''Desc. And examples'''
Return to_24_hour_clock(seconds_elapsed // 3600)
kan
kan
@Mochan exactly!!
:DDD
kan
kan
Next function: get_minutes.
Now, we need to display this on a clock. So, we need to get rid of the seconds corresponding to the number of hours.
How would you do this?
Guessing but... instead of // 3600 do //60? Sorry if its wrong.
kan
kan
No, you're partially right.
Let's do an example:
3700 seconds have elapsed since midnight...
13:49
Ok
kan
kan
What would you see on the clock?
1am
actually 12.52am
kan
kan
@jokerdino H:MM:SS
1:01:66
Waut
1:02:06
kan
kan
@Mochan 66 seconds???
13:50
100 seconds
61.66666666
1:01:40
kan
kan
@jokerdino Right, dino!! ;)
OH I SEE XD
my math not bad
kan
kan
13:52
@Mochan So, did you get the point: we first calculate the number of hours, then, subtract the number of seconds that go into it, then see how many minutes there are and so on...
Yep!
i remember doing these things with java xD
(val1 / val2) + (val1%val2)
kan
kan
Now, can you try to write the function: get_minutes?
keep in mind all the steps in the computation, please.
13:53
@kan how good are you with python?
kan
kan
def get_minutes(sec_elapsed):
we are writing a list of lists on the other chat room ;)
kan
kan
@jokerdino Not that great. Just doing string manipulation. :(
:(
string manipulation should be easy once you get it in any of the language
kan
kan
but I am striving hard to learn..,
13:55
i learnt quite some stuff in java and it is easy in python
kan
kan
@jokerdino true. but, python seems to me more flexible...
it is, i don't disagree.
but it is not really OOPS
return to_24_hour_clock(sec_elapsed//60-%)
I know that's wrong. Do you eat how I'm thinking though?
Get*
kan
kan
@Mochan hey, how did we compute?
Figure out how many... OH.
Is it still //3600?
kan
kan
13:58
@Mochan no, I am not seeing wh you came up with this...
dump the whole code in pastebin
Jd who are you talking to?
wait, you are writing it down. never mind
kan
kan
@jokerdino I could but Mochan won't learn much....
13:59
Yeah.
well, i don't know what she is thinking
it is very abstract
kan
kan
See, let me give you the pseudo algorithmically how we found the number of minutes as displayed on a 24_hour clock is obtained:
pseudo code is useful
kan
kan
1. calculate the number of hours...(you did this as: sec_elapsed // 3600)
14:01
OK good...
kan
kan
comment: now so many hours are gone!
kan
kan
2. so, the remaining seconds are: sec_elapsed - (sec_elapsed // 3600)*3600
3. If you do an integer division of the remaining seconds by 60, you get the number of minutes.
(Run through the above steps with our example, please.)
Suggestion: hope you're having something nearby to scribble.
Does a calculator qualify?
no
get a paper and pencil
14:05
Can't.
right.
kan
kan
what jokerdino said... (please...it helps)
It's 1:05AM...
you can try tomorrow ;?
it's just a simple course.
deadline doesn't matter
Perhaps I should just miss this one... I could send in what I have already and leave the rest blank. Is that OK?
14:07
that sounds fine.
sometimes when you are sleep deprived, you write horrible code
@kan?
@jokerdino I can't even do simple math
kan
kan
@Mochan That sounds good to me.
I'll try this tomorrow morning. If I hurry, there is potential.
kan
kan
@Mochan Not really. Sleep. You'd understand things much better in a relaxed fashion.
14:09
what he said ^
Probably. I'm so stressed. Don't laugh... But I was literally crying before I had you guys help...
:'(
i am glad you are persevering instead of giving up.
Thanks jd. I'll give it a quick shot tomorrow. I might be able to ask someone. In my family for help with the math if I'm no better in the morning.
Ugh... Mobile...
no problem.
go to bed and have a good night rest
kan
kan
Exactly!!
14:13
Ty. Both of you. This really means a lot. If you're ever stuck, I'll try my best to help. -hugs-
it's not like you got school tmrw ;/
Goodnight~
@kan got school tomrw?
@Mochan night!
kan
kan
@Mochan No worries. :-)
@jokerdino Yes. School.
I'm out.
14:14
me 2
kan
kan
@Mochan Good night. :)
@Mochan waves
kan
kan
I must leave for dinner...
kan
kan
Bye. :)
14:16
:)
 
10 hours later…
kan
kan
23:51
@Mochan I thought I'll leave this message for you:
The IDLE thingy is all well. If you want to write some code and keep modifying, File > New Window... Also, note that the menu bar of the new window looks like the one you need. :-)
I got scared unnecessarily.

last day (15 days later) »