-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed6d649
commit 91668db
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
echo "python | ||
Description: | ||
functools | ||
@cache | ||
@total_ordering" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
echo "python | ||
Description: | ||
tuples | ||
Tuples are objects that can store a specific number of other objects in order. | ||
They are immutable, meaning we can't add, remove, or replace objects on the fly. | ||
Tuples are used to store data; behavior cannot be associated with a tuple. | ||
If we require behavior to manipulate a tuple, we hace to pass the tuple into | ||
function. | ||
Examples: | ||
stock = \"FB\", 177.46, 178.67, 175.79 | ||
or | ||
stock2 = (\"FB\", 177.46, 178.67, 175.79) | ||
Access to tuple: | ||
stock = \"FB\", 177.46, 178.67, 175.79 | ||
print(stock[2]) | ||
or | ||
stock = \"FB\", 177.46, 178.67, 175.79 | ||
symbol, current, hight, low = stock | ||
print(symbol) | ||
Named tuples | ||
from collections import namedtuple | ||
Stock = namedtuple(\"Stock\", [\"symbol\", \"current\", \"high\", \"low\"]) | ||
stock = Stock(\"FB\", 177.46, 178.67, 175.79) | ||
stock.symbol | ||
Dataclasses | ||
from dataclasses import dataclass | ||
@dataclass | ||
class DataClassCard: | ||
name: str | ||
current: float | ||
high: float | ||
low: float | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
echo "New command created" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
echo "New command created" |