FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
programmingWithPythonCode/variables/variable_types.py at main · thomasWeise/programmingWithPythonCode · GitHub
thomasWeise
programmingWithPythonCode
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
programmingWithPythonCode
/
variables
/
variable_types.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (10 loc) · 620 Bytes
Breadcrumbs
programmingWithPythonCode
/
variables
/
variable_types.py
Copy path
File metadata and controls
14 lines (10 loc) · 620 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
int_var
=
1
+
7
# Create an integer variable holding an integer number.
print
(
type
(
int_var
))
# This prints "<class 'int'>".
float_var
=
3.0
# 3.0 is a float and it is stored in float_var.
print
(
type
(
float_var
))
# This prints "<class 'float'>".
str_var
=
f"f
{
float_var
=
}
"
# Render an f-string into str_var.
print
(
type
(
str_var
))
# This prints "<class 'str'>".
bool_var
=
(
1
==
0
)
# 1 == 0 is False, so a bool is stored in bool_var.
print
(
type
(
bool_var
))
# This prints "<class 'bool'>".
none_var
=
None
# We create none_var which, well, holds None.
print
(
type
(
none_var
))
# This prints "<class 'NoneType'>".
Back
|
FazBrowse Home
|
New Git URL