how to?

Hello, i'm learning python, python is the first programming language i'm learning.

Owkee here's the question: I need to make an agenda but i don't know where to start.
(build a program that puts all the days in a dictionary, the keys are yyyy - mm - dd, the values is empty list for the appointments. )
I'm not allowed to use functions, or other fancy stuff. I'm just past for loops so I can use for loops.

How do I start with the agenda script. (I don't want a fully working script, I want to program it by myselves.

Is there some kind of a smart trick to get your idea to working code, some standard things that makes it easier to transfer your idea to code.

Thank you,

Comments

  • [b][red]This message was edited by Gregry2 at 2006-7-19 19:13:34[/red][/b][hr]
    : Hello, i'm learning python, python is the first programming language i'm learning.
    :
    : Owkee here's the question: I need to make an agenda but i don't know where to start.
    : (build a program that puts all the days in a dictionary, the keys are yyyy - mm - dd, the values is empty list for the appointments. )
    : I'm not allowed to use functions, or other fancy stuff. I'm just past for loops so I can use for loops.
    :
    : How do I start with the agenda script. (I don't want a fully working script, I want to program it by myselves.
    :
    : Is there some kind of a smart trick to get your idea to working code, some standard things that makes it easier to transfer your idea to code.
    :
    : Thank you,
    :
    [green]
    I just used "Still how to?" to signifiy that this is not answered.

    I forgot how to use dictionaries...lol...I dont program in python much, and simple things like lists are enough for me, but I can answer your latter question.

    Think about a language, a natural language, like English or Japanese. Simply put, unless someone knows a language well, they can't express their ideas or feelings well, right? If they only know half, they can only say little that makes sense and even make mistakes that mislead those who listen to think they mean otherwise. On the flip side, if they know a language well, they can express with ease, even to a point when it becomes natural. This is especially true for one's first language, whatever it may be.

    Programming is the same. After you learn a language well, it becomes natural how you can put your ideas to code, I guess you just need to code and get used to it. Even as sometimes you can "think" in a way in English, you get used to "thinking" in programming in whihc you start to approach problems or goals and see how, in a programming way, to solve it. You just have to get a hand of it, then it gets easier.

    The only way to get this way of thinking, of course, is to practice, and in a while, you'll be thinking statements and stuff. Lol, even when I do normal tasks that have zippo to do with programming or even computers, I think about it as I do a program.

    {2}rIng
    [/green]
  • : [b][red]This message was edited by Gregry2 at 2006-7-19 19:13:34[/red][/b][hr]
    : : Hello, i'm learning python, python is the first programming language i'm learning.
    : :
    : : Owkee here's the question: I need to make an agenda but i don't know where to start.
    : : (build a program that puts all the days in a dictionary, the keys are yyyy - mm - dd, the values is empty list for the appointments. )
    : : I'm not allowed to use functions, or other fancy stuff. I'm just past for loops so I can use for loops.
    : :
    : : How do I start with the agenda script. (I don't want a fully working script, I want to program it by myselves.
    : :
    : : Is there some kind of a smart trick to get your idea to working code, some standard things that makes it easier to transfer your idea to code.
    : :
    : : Thank you,
    : :
    : [green]
    : I just used "Still how to?" to signifiy that this is not answered.
    :
    : I forgot how to use dictionaries...lol...I dont program in python much, and simple things like lists are enough for me, but I can answer your latter question.
    :
    : Think about a language, a natural language, like English or Japanese. Simply put, unless someone knows a language well, they can't express their ideas or feelings well, right? If they only know half, they can only say little that makes sense and even make mistakes that mislead those who listen to think they mean otherwise. On the flip side, if they know a language well, they can express with ease, even to a point when it becomes natural. This is especially true for one's first language, whatever it may be.
    :
    : Programming is the same. After you learn a language well, it becomes natural how you can put your ideas to code, I guess you just need to code and get used to it. Even as sometimes you can "think" in a way in English, you get used to "thinking" in programming in whihc you start to approach problems or goals and see how, in a programming way, to solve it. You just have to get a hand of it, then it gets easier.
    :
    : The only way to get this way of thinking, of course, is to practice, and in a while, you'll be thinking statements and stuff. Lol, even when I do normal tasks that have zippo to do with programming or even computers, I think about it as I do a program.
    :
    : {2}rIng
    : [/green]
    :

    ow thank you man for your reply,
    it makes alot of sence to think that learning a programming language is almost the same as learning a speaking language.

    With that agenda-program i'm a little further now, I've created a loop that gives me the exact number of days in a month. This is usefull because it depends on the month how many days are in it.

    Thanks for your help!
  • : With that agenda-program i'm a little further now, I've created a loop that gives me the exact number of days in a month. This is usefull because it depends on the month how many days are in it.

    If you have a loop, then you can add empty lists to a dictionary like this:

    [code]
    agenda = {} # empty dictionary
    for day in days: # loop over day values
    agenda[day] = [] # each day's agenda starts as empty list
    [/code]

    That's the basic idea of initializing a dictionary where each key's value is an empty list.



    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories