Lecture 1 Flashcards

1
Q

What are the three ways for python to be used in this class

A

1) python, interactive shell, also called REPL
2) Running a python script
3) Jupyter notebook

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In short, what is python interactive shell?

A

Execute Python code interactively line by line. Suitable for simple tasks, experimentation with syntax, checking how function works, or as a calculator. Code is not saved or reusable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In short, what does running a python script do?

A

Run an entire file at once. Suitable for complete programs. Code is saved and reusable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In short, what does Jupyter notebook do?

A

Run smaller sections of code one at a time. Integrated documentation/instrumentation to make the code more interactive and user-friendly. Great for teaching/learning and science applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to open a new terminal in VS code

A

Select terminal then select new terminal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to make the terminal interact with python code?

A

Type the lowercase word Python into the terminal window and click enter. The terminal is now interactive. To close the terminal type exit().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to open a python script

A

In vs code select file then new file in the pop-up window that appears select python file. Save the file by selecting file, then save as.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to use a print function.

A

For a printed sentence type print(“words”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the input command?

A

input(“prompt”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Do white spaces or tabs impact python?

A

Yes, be careful. They will cause unexpected errors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does order impact Jupiter notebook?

A

Cells are running the order you specify which may not be from top to bottom. The order in which cells are executed is indicated by the number in the square bracket beside the code cell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly