Chap 8 - programing - print, if/elif/else, loops, len, string manipulation Flashcards
name 6 data types
-integer
-string
-boolean
-float
-character (char)
-date
how do you use the print function
print(“ “)
2 ways you can print messages on print function
-comma
-concatenation (adding)
meaning of concatenation
join together
how do you use comma when printing
use comma between words
how do you use concatenation when printing
use ( + ) to add the strings
what is the difference between using comma and concatenation
space in comma, no space in concatenation
can you add strings
yes
can you add strings and integers
no
what data types are \t and \n
strings
what must you put when using \t and \n
quotations
what does \t do
a tab of space
what does \n do
a new line
what does = do
assignment of variable
what does != mean
not equal
3 rules for variables
-has to start with a char
-case sensitive
-no special char and spaces - willc hange program (except underscore)
operation for addition
+
operation for subtraction
-
operation for multiply
*
operation for division
/
operation for power
**
operation for squared
**(1/2)
operation for division (reminder)
%
operation for division (float)
/
operation for division (integer)
//
operation for not equal to
!=
which takes place first: maths operations or assignment of variable
maths operations
what is a list
-stores a list of items
-temporary
what is a tuple
-stores fixed items
-permament
how do you use list
fruits = [“apples”,”orange”]