FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
programmingWithPythonCode/variables/variable_types_wrong.py at main · mlecjm/programmingWithPythonCode · GitHub
mlecjm
programmingWithPythonCode
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
programmingWithPythonCode
/
variables
/
variable_types_wrong.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
5 lines (4 loc) · 256 Bytes
Breadcrumbs
programmingWithPythonCode
/
variables
/
variable_types_wrong.py
Copy path
File metadata and controls
5 lines (4 loc) · 256 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
int_var
=
1
+
7
# Create an integer variable holding an integer number.
print
(
type
(
int_var
))
# This prints "<class 'int'>".
int_var
=
int_var
/
3
# / returns a float, but we may expect an int?
print
(
type
(
int_var
))
# This now prints "<class 'float'>".
Back
|
FazBrowse Home
|
New Git URL