Introduction

lab00

wget https://cs61a.org/lab/lab00/lab00.zip
unzip lab00.zip

实验目录下有如下文件:

$ ls
__pycache__ lab00.ok lab00.py ok tests

下面是解释:

  • lab00.py: the starter file you just edited
  • ok: our testing program
  • lab00.ok: a configuration file for Ok

关于 ok 的命令生成器:

okpy Command Generator

lab00 要求很简单:

def twenty_twenty_two():
"""Come up with the most creative expression that evaluates to 2022,
using only numbers and the +, *, and - operators.

>>> twenty_twenty_two()
2022
"""
return 2022

用表达式返回值 2022 即可,这里我就直接返回了😸。

python3 ok

执行,如果想submit,可以换成 python3 ok submit