Programming 2 Flashcards
get better at python
can you combine strings and numbers in python ?
you cant do it directly unless u add str before the number
eg : (“yoyo” + str(123))
Where should normal arguements be placed ?
Normal arguements should be placed before variable arguements , ALWAYS
What is the special case called where you add another statement apart from “if” and “else” statements
“elif” statements are used , these statements allow us to add more than one condition
Collection
grouping multiple items tgt and storing them in a single name (variable)
List
groups pieces of data tgt in a certain order and assigns the collection a name
Should you add comma at the end of a list/array ?
Yes
Mutable & Immutable values
- mutable = values that can be changed after their created
- immutable = values that cant be changed once created
Iteration
repeats the same procedure multiple times until it ends
- loop is a code that iterates
Module
Python file that contains code, like variable or functions
Python Libraries
- machine learning tasks
* TensorFlow
* pandas - Math stuff
* Numpy
* Scipy
Python Frameworks
used for web development management
- Django
- Flask
Concatenate
combine multiple strings into one string
Slicing
getting part of a string value
string[start:end]
String methods
(making changes/finding strings etc)
newstringname.stringname.methodname()
- the new string name is the new name u give the string
- the stringname is the string that u want to add the function or wtv to
- the “.” is used to tell python that a method/change is coming next
- method name is what u wanna do to the string
- always end with ()
Regular Expression
aka Regex
Allows you to create a description of a pttern that you want to match