This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
smoothie_fruits = ("Pineapple", "orange", "banana", "apple") | |
for fruit in smoothie_fruits: | |
print(fruit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skills = tuple(["Python", "Maths", "Machine Learning"]) | |
print(type(skills)) | |
print(skills) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numbers = (1, 2, 3) | |
numbers2 = 1, 2, 3 | |
print(type(numbers)) | |
print(type(numbers2)) | |
print() | |
print(numbers) | |
print(numbers2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skills = "Python", | |
skills2 = ("Data Science",) | |
print(type(skills)) | |
print(type(skills2)) | |
print() | |
print(skills) | |
print(skills2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_tuple = () | |
my_tuple2 = tuple() | |
print(type(my_tuple)) | |
print(type(my_tuple2)) | |
print() | |
print(my_tuple) | |
print(my_tuple2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unique_identifier = 42 | |
age = 24 | |
skills = ("Python", "pandas", "scikit-learn") | |
info = (unique_identifier, age, skills) | |
print(id(unique_identifier)) | |
print(id(age)) | |
print(info) | |
unique_identifier = 50 | |
age += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skills = ["Programming", "Machine Learning", "Statistics"] | |
person = (129392130, skills) | |
print(type(person)) | |
print(person) | |
skills[2] = "Maths" | |
print(person) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numbers = [1, 2, 3] | |
numbers2 = [1, 2, 3] | |
print(numbers == numbers2) | |
print(numbers is numbers2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
text = "Python" | |
text2 = text | |
print(id(text)) | |
print(id(text2)) | |
print(text is text2) | |
print() | |
text += " is awesome" | |
print(id(text)) | |
print(id(text2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
values = [4, 5, 6] | |
values2 = values | |
print(id(values)) | |
print(id(values2)) | |
values.append(7) | |
print(values is values2) | |
print(values) | |
print(values2) |