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 = "Data Science" | |
print(id(text)) | |
text += " with Python" | |
print(id(text)) |
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
number = 42 | |
print(id(number)) | |
number += 1 | |
print(id(number)) |
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
list_values = [1, 2, 3] | |
set_values = (1, 2, 3) | |
print(id(list_values)) | |
print(id(set_values)) | |
print() | |
list_values += [4, 5, 6] | |
set_values += (4, 5, 6) | |
print(id(list_values)) | |
print(id(set_values)) |
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
list_values = [1, 2, 3] | |
set_values = (10, 20, 30) | |
list_values[0] = 100 | |
print(list_values) | |
set_values[0] = 100 |
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
list_values = [1, 2, 3] | |
set_values = (10, 20, 30) | |
print(list_values[0]) | |
print(set_values[0]) |
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
def sum_numbers(number1, number2): | |
print(number1 + number2) | |
result = sum_numbers(10, 5) | |
print(result) |
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
def sum_numbers(number1, number2): | |
return number1 + number2 | |
result = sum_numbers(10, 5) | |
print(result) |
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
def sum_numbers(number1, number2): | |
print(number1 + number2) | |
sum_numbers(10, 5) |
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
def print_message(text): | |
print(text) | |
print_message("Forgive yourself for your faults and your mistakes and move on. - Les Brown") |
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
import datetime # importing the "datetime" module | |
def print_current_date(): | |
current_date = datetime.datetime.now().date() | |
print(current_date) | |
print_current_date() |