Unit 2 : Python - Introduction Flashcards
1
Q
What does user see computer as?
A
- As a set of tools ( Word Processor, Map )
2
Q
What can we do as a programmer ? ( 3 )
A
- Learn the programming languages
- Use tools to build new tools ( VS Code to develop Apps )
- Write tools to automate task
3
Q
What is a code called when it was executale?
A
- Program
4
Q
What should we add at the end of out python file?
A
- .py ( main.py )
5
Q
What should we do when naming variables? ( 4 )
A
- Create a meaningful name ( radius , practice_number )
- Contain letters, numbers and underscore
- Underscore can be used for multi-word variable name ( student_name )
- Use _ when the next was letter ( num1 not num_1 )
6
Q
What should we not do when naming variable ? ( 2 )
A
- Cannot begin with a number
- Cannot use the keywords and the reserved words
7
Q
Is variable name case-sentive?
A
- Yes ( radius is not the same as Radius )
8
Q
What is code?
A
- A set of instructions that reflects human intelligence and problem-solving ability
- Can also be seen as a form of creative expression, especially when attention is given to how users interact with the program ( UX )
9
Q
What does software allows us to do?
A
- Package and share this intelligence with others, helping them accomplish tasks without having to solve the underlying problems themselves
10
Q
What is Interactive?
( Interactive Python )
A
- Using the interpreter or shell, we can type in commands to get immediate results
11
Q
What is script?
A
- Save the code into single file ( .py in python )
12
Q
What is the difference between interactive vs script ?
A
- Interactive
- You type directly to Python one line at a time and it responds
- Script
- You enter a sequence of statements (lines) into a file using a text editor and tell Python to
execute the statements in the file
- You enter a sequence of statements (lines) into a file using a text editor and tell Python to
13
Q
What is constants? What are the valued stored inside constant ?
A
- Fixed Values
- Numbers, letters and strings
- String constants uses single-quote ( ‘ ) or double-quotes ( “ )
14
Q
What is a variable ?
A
- A named place in the memory where a programmer can store data and later retrieve the data using the variable “name”
15
Q
When should we use assignment operator? What is the symbol of assignment operator?
A
- When we assign a value to a variable
- =
- It consists an expression on the right hand side and variable name to store the result