Show more examples?

QuestionsQuestions8 SkillsProYour First Python LabSep, 04 2025
0133

Sure! Here are a few more examples of variable assignments and how to retrieve their values in Python:

Example 1: Integer Assignment

age = 30
print(age)  # Output: 30

Example 2: Float Assignment

height = 5.9
print(height)  # Output: 5.9

Example 3: List Assignment

fruits = ["apple", "banana", "cherry"]
print(fruits)  # Output: ['apple', 'banana', 'cherry']

Example 4: Boolean Assignment

is_student = True
print(is_student)  # Output: True

Example 5: Dictionary Assignment

person = {"name": "Alice", "age": 30}
print(person)  # Output: {'name': 'Alice', '

0 Comments

no data
Be the first to share your comment!