Learn Python in Jupyter Notebook Python? ๐Ÿš€

Jupyter Notebook For Python Programming with ChatGPT jupyter notebook python
You are currently viewing Learn Python in Jupyter Notebook Python? ๐Ÿš€
Jupyter Notebook For Python Programming with ChatGPT jupyter notebook python

Learn Python in Jupyter Notebook Python? ๐Ÿš€

Jupyter Notebook Python is like a smart digital notebook that lets you write and run code in blocks (called “cells”). Itโ€™s widely used in data science, machine learning, education, and automation.

With platforms like Google Colab, you donโ€™t even need to install anything. Just visit the site, and start coding.

๐Ÿ“ Course Content (with Video + Code + Super Easy Explanations)


๐ŸŽฌ Introduction to the Course

  • Youโ€™ll learn Python using Jupyter Notebook (Google Colab).
  • No experience required.
  • Everything runs in your browser.

๐Ÿ—’๏ธ What is Jupyter Notebook?

  • Itโ€™s like a smart notebook that runs code in blocks.
  • Used by Google, students, and developers.
  • No installation if you use Google Colab.

๐Ÿ’ป Open Google Colab and Run Python

Steps:

  1. Go to colab.research.google.com
  2. Click on New Notebook
  3. In a code cell, type:
print("Hello, Python!")

โœ… This shows output in the next block.


๐Ÿ”  Python Variables

name = "Kunal"
age = 24
price = 19.99

print(name)
print(age)
print(price)
  • name: text โ†’ string
  • age: number โ†’ integer
  • price: decimal โ†’ float

โž• Python Operators

a = 10
b = 3

print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a ** b) # power (10^3 = 1000)
  • +, -, *, / โ†’ calculator stuff
  • ** โ†’ power

๐Ÿ“ Notes: Taking User Input in Python

โœ… What is input()?

The input() function lets the user type something while the program is running.

๐Ÿงช Example:

name = input("What is your name? ")
print("Hello,", name)

๐Ÿ’ก What happens:

  • Python shows the message: What is your name?
  • The user types something (like: Kunal)
  • Python stores it in the name variable and prints:
    Hello, Kunal

๐Ÿ“Œ Important:

  • input() always returns text (a string), even if you type numbers.

๐Ÿ“ Notes: f-Strings in Python

โœ… What is an f-string?

An f-string is a clean way to include variables inside a sentence.

๐Ÿงช Example:

name = "Kunal"
age = 24
print(f"My name is {name} and I am {age} years old.")

๐Ÿ’ก Output:

My name is Kunal and I am 24 years old.

๐Ÿ“Œ Why use f-strings?

  • Easier to write
  • Easier to read
  • Works with text, numbers, and even calculations

๐Ÿงช Another example:

a = 10
b = 5
print(f"Total: {a + b}")

โœ… Output: Total: 15


๐Ÿง  Conditional Statements โ€“ if else

age = 18

if age >= 18:
print("You are an adult.")
else:
print("You are a minor.")
  • Runs different blocks based on conditions
  • Python uses indentation (spaces) for blocks

๐Ÿ” Loops in Python

For Loop:

for i in range(5):
print("Number:", i)

While Loop:

x = 0
while x < 3:
print("x is", x)
x += 1
  • for = fixed number of times
  • while = until a condition is true

โš™๏ธ Functions in Python

def greet(name):
print("Hello", name)

greet("Kunal")
  • def creates a function
  • You can re-use it by calling it again

๐Ÿ“ฆ Lists in Python

fruits = ["apple", "banana", "mango"]
print(fruits[0])

fruits.append("orange")
print(fruits)
  • List = multiple values in one variable
  • append() adds items
  • Index starts at 0

๐Ÿงฎ Final Project: Mini Calculator

# Simple Python Calculator using input and f-strings

# Ask for user input
a = float(input("Enter the first number: "))
b = float(input("Enter the second number: "))
operation = input("Enter operation (add, subtract, multiply, divide): ")

# Define the calculator function
def calculator(a, b, operation):
if operation == "add":
return a + b
elif operation == "subtract":
return a - b
elif operation == "multiply":
return a * b
elif operation == "divide":
if b != 0:
return a / b
else:
return "Cannot divide by zero."
else:
return "Invalid operation."

# Run the function and show result using f-string
result = calculator(a, b, operation)
print(f"The result of {operation}ing {a} and {b} is: {result}")
  • ๐Ÿ’ก Example Output:

  • Enter the first number: 10
  • Enter the second number: 5
  • Enter operation (add, subtract, multiply, divide):
  • The result of multiplying 10.0 and 5.0 is: 50.0

  • Combines function + if-else
  • Easy way to apply everything you learned

๐Ÿค– Bonus: Use ChatGPT in Jupyter

You can use comments to guide ChatGPT like this:

# ChatGPT, write a function to check if a number is even

Tools like ChatGPT or GitHub Copilot will complete the function for you.


โœ… Summary & Next Steps

s


If you’re searching how to get started with jupyter notebook python, this guide is the most beginner-friendly path you’ll findโ€”no installations, just results.


๐Ÿง  Final Thoughts

You now have a solid foundation in Python using Jupyter Notebook. This method is perfect for anyone who wants to get started fast without the headache of setting things up.

Kunal Lonhare

I am the founder of Kuku Courses