Skip to content

Instantly share code, notes, and snippets.

View techstackmedia's full-sized avatar
🏠
Working from home

Bello Osagie techstackmedia

🏠
Working from home
View GitHub Profile
# Numbers
integer_number = 23
floating_point_number = 23.5
complex_number = 2 + 3.8j
# Boolean
boolean_value = True
# String Literal
string_literal = 'This is a text.'
x = 4.5
x.is_integer()
# False
x = 4.0
x.is_integer()
# True
type(x.is_integer)
# <class 'builtin_function_or_method'>
x = 1 # x is an integer
x = 'hello' # now x is a string
x = [1, 2, 3] # now x is a list
# Python code
# Python is a dynamically-typed language
x = 4
// C code
// C is a statically-typed language
int x = 4;
# assign 4 to the variable x
x = 4