How to write and run more than one code in Python IDLE?

前端 未结 1 740
温柔的废话
温柔的废话 2021-01-25 12:43

How do you get that code, see below, run in IDLE? I am stuck in my course right now and I could not find an explanation. I know how to run in IDLE just one \"def\" or code, pre

1条回答
  •  长发绾君心
    2021-01-25 12:55

    To answer your last question first: table is a triple list, so a list of lists containing lists. One of those lists is [['Bill', 17], ['Zoe', 14]]. Since hash_string returns an index, it retrieves one list out of table, which happens to be the one with Bill and Zoe.

    Further, to run more than one function from within IDLE, you will have to create a new function (a new def my_assignment or something) that calls the other functions.

    Hope this helps.

    0 讨论(0)
提交回复
热议问题