chapter_one Flashcards

You learn a bit about Python in general, the Sublime Text editor and other programming invironments as well as the Command Window.

1
Q

How do you check if python is installed on your computer and which version?

A

1) by opening the command window / terminal

2) and typing “python” in lower case.

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

How do you exit python in the command / terminal window ?

A

1) “CTRL-Z” and “ENTER”

2) or type “exit()”

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

How should you name your folders

and files that contain Python projects?

A

1) Use lowercase letters
2) and underscores for spaces, because Python is using these naming conventions.

3) Save Program files with the “.py” extension
4) so Sublime Text can tell that it is working with Python code.

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

How do you run your program in Sublime Text?

A

1) Either manually by clicking “Tools” > “Build” in the menu
2) or by pressing “CTRL-B”

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

What is a traceback?
Why is it showing
and what does it display?

A

1) Its Pythons error report.
2) A traceback is a record of where the interpreter ran into trouble when trying to execute your code.
3) It displayes the line where an error has been found, the error type and some kind of error description.

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

What does IDE stand for?

A

1) integrated
2) development
3) environment

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

What functions does a Text editor
and an IDE have?
Why even use a Text edior?

A

Text editor:

1) simple tasks: highlighting your code’s structure, automating indenting, keyboard shortcuts
2) simple than IDE
3) puts a lighter load on your computer

IDE:

4) text editor with a number of included tools
5) an interactive debugger, code introspection, shows you common arguments for the code you are writing

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

How to convert “Tabs” to “Spaces” in Sublime Text Menu?

What do you do if you want to change your “Tabs” to “Spaces” in an allready existing file?

A

1) Click on “View” > “Indentation” in the menu.
2) Another way to get to this menu option is by clicking “Spaces” in the botom right of the file.

3) Activate “Indent Using Spaces” and make sure the “Tab Width” is set to “4”.
4) To change the “Tabs” to “Spaces” in an allready existing file, by doing the same thing described above.

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

How do you set the line lenght indicator in Sublime Text?

A

1) go to “View” > “Ruler”

2) and click “80”

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

Name 7 of the most common Text editors or IDEs.

A

1) IDLE
2) Geany
3) Emacs and Vim
4) Atom
5) Visual Studio Code (VS Code)
6) PyCharm
7) Jupyter Notebook

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

What do you do when you’re stuck?

A

1) 1. Assess your Situation:
2) What are you trying to do?&raquo_space;> What have you tried so far?&raquo_space;> What results have you been getting?
3) answer these questions as specific as possible&raquo_space;> Talk to the duck!

4) 2. Try again
5) Go through the same steps again.

6) 3. Take a break

7) 4. Search Online
8) Stack Overflow; Official Pyton / Library Documentation; r/learnpython; Blog Posts; Internet Relay Chat (IRC); Discord

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

How do you navigate the terminal and how do you run python in it?

A

1) “dir” (directory) or “ls” (list)&raquo_space;> shows the folders you can navigate into

2) “cd” (change directory)&raquo_space;> allows you to navigate to a chosen folder (ex. cd Desktop)
3) to go back up the directory type “cd ..”

4) “D:”&raquo_space;> lets you jump to other drives by typing the drives letter with colon
5) Then type “python” and the file you want to run (ex. python hello_world.py)

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

How do you display someting in the console with code?

Give an example.

A

1) print( )
2) everything in the bracket can be displayed.

3) print(“hello world!”)&raquo_space;> hello world

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

Describe some of “IDLE”s characteristics.

A

1) Text editor
2) included with Python

3) for beginners
4) less intuitive than Sublime

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

Describe some of “Geany”s characteristics.

A

1) Text editor
2) simple but powerful
3) output displayed in terminal window

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

Describe some of “Emacs”s and “Vim”s characteristics.

A

1) Keyboard only
2) steep learining curve
3) run entirely in terminal
4) code for servers

17
Q

Describe some of “Atom”s characteristics.

A

1) Text editor that behaves like an IDE
2) project folder
3) Git & GitHub
4) install packages

18
Q

Describe some of “PyCharm”s characteristics.

A

1) Popular IDE
2) built for Python
3) linter (checks if your code style matches common conventions)
4) suggestions for formating

19
Q

Describe some of “VS Code”s characteristics.

A

1) Text editor that behaves like an IDE
2) debugger
3) version control
4) code completion tools

20
Q

Describe some of “Jupyter Notebook”s characteristics.

A

1) Web app
2) Python scientific application, datafocused
3) write clear text
4) independent testing
5) can be confusing