Intro to Programming Flashcards
The output of the input function is always a
string
pros/cons of python
- can quickly write programs
- no overhead
cons: not as fast/efficiently
Why to not use word processor?
screw up the formatting
Process for programs to be ready by computer
program is yranslated into binary machine language
do not click on the previously created program to open it because….
operating system will try to run python programs (not allow you to edit it)
Naming files (2)
- no spaces
- Use alphabetical characters, numbers may be used but the first number is only alphabetic
Variables (3)
used to do what?+what happen if u put anothe info in+accesibility?
- Used to store information (temporary)
- can store one piece, putting another peice can overwrite previous entry
- at most the info will be accesible as long as the program runs
type of info that can be stored in variables: (3)
- integers (whole number)
- floating point (fractional)
- strings (character info)
The assignment operator+ tell me about photocopying (y=3 x=y y=6)
- not the same as equal
- you change y when y=x, x doesnt change
When naming a variable (3)
- names must start with a letter and should not behin with an underscore
- should be all lower case
division symbol
/
integer division symbol+ what it does
//
9//2 ->4
exponent symbol
**
order of operation (2)
- brackets, exponent, multiplication/division/modulo, addition/subtraction, assignment
- If there are multiple operations that are on the same level then prescendance goes from left to right
Triple quote
Prints exactly what you typed