filmov
tv
4. Variables and Data Types #python

Показать описание
4. Variables and Data Types
Short Code:
# Defining different types of variables
name = "Olivia" # String
age = 22 # Integer
height = 5.3 # Float
is_student = True # Boolean
print(name, age, height, is_student)
Long Code:
# This script defines variables of different data types and prints them.
def display_info():
# Variables with different data types
name = "Skylar" # String
age = 22 # Integer
height = 5.3 # Float
is_student = True # Boolean
# Print the variables with a descriptive message
print(f"Name: {name}")
print(f"Age: {age}")
print(f"Height: {height} ft")
print(f"Is a student: {is_student}")
# Call the function to display the information
display_info()
#python #programming #coding #java #javascript #snake #programmer #html #developer #computerscience #snakes #reptiles #ballpython #technology #pythonprogramming #reptile #coder #datascience #snakesofinstagram #css #linux #machinelearning #code #reptilesofinstagram #software #webdevelopment #webdeveloper #php #tech #pythons
Short Code:
# Defining different types of variables
name = "Olivia" # String
age = 22 # Integer
height = 5.3 # Float
is_student = True # Boolean
print(name, age, height, is_student)
Long Code:
# This script defines variables of different data types and prints them.
def display_info():
# Variables with different data types
name = "Skylar" # String
age = 22 # Integer
height = 5.3 # Float
is_student = True # Boolean
# Print the variables with a descriptive message
print(f"Name: {name}")
print(f"Age: {age}")
print(f"Height: {height} ft")
print(f"Is a student: {is_student}")
# Call the function to display the information
display_info()
#python #programming #coding #java #javascript #snake #programmer #html #developer #computerscience #snakes #reptiles #ballpython #technology #pythonprogramming #reptile #coder #datascience #snakesofinstagram #css #linux #machinelearning #code #reptilesofinstagram #software #webdevelopment #webdeveloper #php #tech #pythons