mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-04 05:47:53 +02:00
Add data type checking examples
This commit is contained in:
committed by
GitHub
parent
61c8a08434
commit
3ffb8256ae
@@ -363,6 +363,12 @@ filled_set | other_set # => {1, 2, 3, 4, 5, 6}
|
|||||||
# Check for existence in a set with in
|
# Check for existence in a set with in
|
||||||
2 in filled_set # => True
|
2 in filled_set # => True
|
||||||
10 in filled_set # => False
|
10 in filled_set # => False
|
||||||
|
10 not in filled_set # => True
|
||||||
|
|
||||||
|
# Check data type of variable
|
||||||
|
type(li) # => list
|
||||||
|
type(filled_dict) # => dict
|
||||||
|
type(5) # => int
|
||||||
|
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
|
Reference in New Issue
Block a user