Posts

Showing posts from April, 2025

User Input in Python | Python Notes By Mr. BILRED - TechAmbitionX

Image
User Input in Python — Learn input(), int(), float(), and getpass() | TechAmbitionX User Input in Python — Talk to Your Code! What is User Input? User input means taking data from the user while the program is running . In Python, we use the built-in input() function. Basic Example name = input("What's your name? ") print("Hello, " + name + "!") Output: What's your name? Mr. BILRED Hello, Mr. BILRED! Want Numbers? Convert Them input() always returns a string . If you want a number, convert it like this: age = int(input("Enter your age: ")) print(age + 1) You Can Use float() too gpa = float(input("Enter your GPA: ")) print("apki GPA times 2 is", gpa * 2) Use Inputs in Real Programs username = input("Username: ") password = input("Password: ") print(f"Logging in as {username}...") 🔐 Optional: Hide Sensitive Input from getpass import getpass password = get...

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...

Python Data Types - Beginner Python Notes By Mr. Bilred - TechAmbitionX

Image
Python Data Types — What’s Inside the Box? | TechAmbitionX Python Data Types — What’s Inside the Box? So you’ve got a variable, like x = 5 Cool, but what type of thing is that? In Python, every value has a data type . Think of it like the kind of stuff inside the box. Common Python Data Types Integer (int): Whole numbers age = 21 Float: Decimal numbers pi = 3.14 String (str): Text name = "Bilal" Boolean (bool): True or False is_alive = True List: Collection of items fruits = ["apple", "banana", "cherry"] Dictionary (dict): Key-value pairs user = {"name": "Bilal", "age": 21} NoneType: Represents nothing result = None And remember, List have Square Brackets, And dictionary have Curly braces How to Check Data Type You can check what type something is using the type() function: print(type(...

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...

Goodbye, Elon – A Letter from a Believer

Image
Goodbye, Elon – A Letter from a Believer Goodbye, Elon By Bilal Ahmad Khan AKA Mr. BILRED | 13th April, 2025 Elon... I looked up to you. I saw someone who dared, someone who dreamed crazy and made it real. The outcast. The genius. The builder. The dreamer who doesn’t give up. You weren’t just another billionaire to me. You were the rebel. The guy who didn’t care what the world said. You built rockets, cars, and dreams. I talked about you to my mother, to my teachers, to my friends. I defended you. I BELIEVED in you. Seriously man, I remember my College/High School days, and you literally were a hero for me. But today… You stood with the ones who oppress. And it broke something inside me. You were my hero, Elon. But today, I let you go. Not with anger. Just... pain. "Because the version ...

C++ Prog Lang In A Nutshell VOL #2 Compiled By Bilal Ahmad Khan AKA Mr. BILRED - TechAmbitonX

Image
C++ Notes VOL #2 Released | TechAmbitionX C++ Prog Lang In A Nutshell VOL #2 Compiled by Mr. BILRED (aka Bilal Ahmad Khan) Alhamdulillah! The second volume of my C++ notes is finally released Alhamdulillah After late-night edits and exam pressure (maybe), I’ve put together another handout. Actually, it's my midterm right now... and I thought — why not compile VOL #2? What’s Inside? Functions, UDFs, Pass-by-Value / Reference Searching & Sorting (Linear, Binary, Bubble, Merge etc.) Cheatsheets for quick revision Final thoughts and insights It’s a sidekick, not the entire combo meal. But if you're someone who values conceptual clarity over technical jargon , this might just help you out! 📥 Visit GitHub 📥 Drive Download

C++ Prog Lang In A Nutshell VOL #2 Compiled By Bilal Ahmad Khan AKA Mr. BILRED - TechAmbitonX

Image
C++ Notes VOL #2 Released | TechAmbitionX C++ Prog Lang In A Nutshell VOL #2 Compiled by Mr. BILRED (aka Bilal Ahmad Khan) Alhamdulillah! The second volume of my C++ notes is finally released Alhamdulillah After late-night edits and exam pressure (maybe), I’ve put together another handout. Actually, it's my midterm right now... and I thought — why not compile VOL #2? What’s Inside? Functions, UDFs, Pass-by-Value / Reference Searching & Sorting (Linear, Binary, Bubble, Merge etc.) Cheatsheets for quick revision Final thoughts and insights It’s a sidekick, not the entire combo meal. But if you're someone who values conceptual clarity over technical jargon , this might just help you out! 📥 Visit GitHub 📥 Drive Download

What Are Vectors in C++? | TechAmbitionX - Bilal Ahmad Khan AKA Mr. BILRED

Image
What Are Vectors in C++? | TechAmbitionX 🔷 What Are Vectors in C++? Posted on TechAmbitionX by Mr. BILRED ✅ Definition: A vector in C++ is a dynamic array from the Standard Template Library (STL). Unlike normal arrays, vectors can grow and shrink in size during runtime. #include <vector> std::vector<datatype> name; 🚀 Why Use Vectors? Dynamic resizing ✅ Easy to use ✅ Built-in functions ✅ Safe access with .at() It works just like [ ], but with built-in bounds checking. ✅ 🔧 Common Methods: Method Description push_back(x) Adds element x to the end pop_back() Removes the last element size() Returns the number of elements empty() Checks if vector is empty clear() Removes all elements at(index) Safe access to element at index begin(), end() Used for iterating 🧠 How It Works Internally: Vectors store elements in a dynamic array. When they run out of space, they automatically: Create a new, larger arr...

1D & 2D Arrays in C++ ProgLang - Bilal Ahmad Khan AKA Mr. BILRED - TechAmbitionX

Image
1D & 2D Arrays - TechAmbitionX Understanding 1D and 2D Arrays Arrays are like containers that hold multiple values. Dusray alfaaz mein, An array is similar to a variable, but instead of storing a single value, it holds multiple values of the same type. These values are stored in consecutive memory locations. Let's dive into 1D and 2D arrays ! 1D Arrays A 1D (one-dimensional) array is like a simple list of values stored in memory. Example: // 📂 This File can also be accessed through: https://github.com/BilalAhmadKhanKhattak/CppNotes/blob/main/Arrays/1dArray.cpp // find the max in 1D array..... o bhai sab! #include using namespace std; int main() { int arr[5] = {23,4,12,6,64}; // This is what we call 1D array int maxNum = arr[0]; // for now, I'm gonna set it to 23 (just for now) watch and learn // I'll use loop to find the max in the array. Loops through the a...