Posts

Showing posts with the label python proglang

Strings In Python - Python Notes By Mr. BILRED | TechAmbitionX

Image
Strings in Python — Say Hello to Text | TechAmbitionX Strings in Python — Say Hello to Text A string in Python is just a bunch of characters inside quotes. Single quotes or double quotes — both work: name = "Bilal" greeting = 'Hello World' empty = "" They can contain numbers, symbols, even emojis: info = "Python 3.11 rocks! 🤘" How to Use Strings in Python 1. Concatenation (Joining Strings) first = "Mr. " last = "BILRED" full = first + last print(full) # Mr. BILRED 2. String Length name = "Bilal" print(len(name)) # 5 3. Accessing Characters name = "Bilal" print(name[0]) # B print(name[-1]) # l 4. Slicing Strings (obv that means k "kaatna") print(name[0:3]) # Bil print(name[:4]) # Bila print(name[2:]) # lal 5. String Methods msg = "python is awesome" print(msg.upper()) # PYTHON IS AWESOME print(msg.capitalize()) # Python...

What Are Variables In Python - Python Notes By Mr. BILRED - TechAmbitionX

Image
What Are Variables in Python? | TechAmbitionX What Are Variables in Python? Alright, let’s keep it simple. A variable is just a name that stores some value . Like a box with a label on it. When you write: x = 5 You’re saying: “Hey Python, make a box called x , and put the number 5 inside it.” Some Examples: name = "Bilal" age = 21 pi = 3.14 You can use these variables later in your program: print(name) print(age + 1) Variables Can Store: Numbers ( int , float ) Text (called strings ) Boolean values ( True or False ) Lists, dictionaries, and more Variable Naming Rules: In x = 10 "x" is the identifier for the variable storing the value 10. Try not to forget the following rules Don’t start names with a number No spaces allowed (use underscores like user_name ) Use meaningful names (atleast when you're showing that to your boss) Wanna Try? x = "Mr. BILRED" print("Welcom...

Your First Program In Python - Python Notes By Mr. BILRED - TechAmbitionX

Image
Learn Python - TechAmbitionX Okay, so you’ve decided to learn Python... Good, but wait, Why? (Go ask yourself) Now listen, I don't know for whatever reason you're learning Python Proglang, but this is what CAN be believed about it: Python is not just a language, it’s your gateway to automation, data science, web development, AI, and beyond. Today, start your Python journey with the absolute basics Python is a high-level, beginner-friendly programming language known for its clean syntax and readability. It’s used by tech giants like Google, Netflix, and NASA. Why Python? Easy to read, easy to write. Big companies use it (Google, Netflix, even NASA). Used in AI, Data Science, Machine Learning, Automation, you know! You can build websites, automate boring stuff, work on AI, or just mess around and learn. How to install Python Go to python.org and install the latest version of Python. Download any C...