Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ipython-console/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code Snippets and IPython Cheat Sheet

This folder contains code resources and an IPython magic command cheat sheet based on the content of the Real Python tutorial [Unlock IPython's Magical Toolbox for Your Coding Journey](https://realpython.com/ipython-interactive-python-shell/).
4 changes: 4 additions & 0 deletions ipython-console/employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
first_name = "Han"
last_name = "Solo"
department = "Accounts"
salary = 1000
10 changes: 10 additions & 0 deletions ipython-console/employee_embedded.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import IPython

first_name = "Han"
last_name = "Solo"
department = "Accounts"
print(f"{first_name} {last_name}")

IPython.embed()

salary = 1000
12 changes: 12 additions & 0 deletions ipython-console/increment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def salary_increment(salary):
"""Calculate the new salary after applying an increment.

Args:
salary (int): The current salary.

Returns:
str: A string indicating the new salary after increment.
"""
increment = salary / 10
new_salary = increment + salary
return f"Your New Salary is: {new_salary}"
Binary file added ipython-console/ipython-cheat-sheet.pdf
Binary file not shown.