Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Friday, 10 July 2026

Python Basics Syllabus


Python Basics

Class 1 – Introduction to Python

  • What is Python?

  • Applications of Python

  • Installing Python

  • VS Code

  • Jupyter Notebook

  • Google Colab

  • Variables

  • Data Types

  • Input & Output

  • Comments

Class 2 – Operators

  • Arithmetic Operators

  • Assignment Operators

  • Comparison Operators

  • Logical Operators

  • Membership Operators

  • Identity Operators

Class 3 – Conditional Statements

  • if

  • if-else

  • elif

  • Nested if

  • Short-hand if

Class 4 – Loops (Part 1)

  • while Loop

  • for Loop

  • range()

  • Nested Loops

Class 5 – Loops (Part 2)

  • break

  • continue

  • pass

  • Practical Loop Problems

Class 6 – Strings (Part 1)

  • Creating Strings

  • Indexing

  • Slicing

  • String Operators

Class 7 – Strings (Part 2)

  • String Methods

  • Formatting

  • Escape Characters

  • f-Strings

Class 8 – Lists

  • Creating Lists

  • Indexing

  • Slicing

  • List Methods

  • Nested Lists

Class 9 – Tuples & Sets

Tuples

  • Creating Tuples

  • Tuple Methods

  • Packing & Unpacking

Sets

  • Creating Sets

  • Set Methods

  • Set Operations

Class 10 – Dictionaries

  • Creating Dictionaries

  • Accessing Values

  • Dictionary Methods

  • Nested Dictionary

Class 11 – Functions

  • Function Basics

  • Parameters

  • Return Statement

  • Scope

  • Lambda Functions

Class 12 – Modules & Exception Handling

  • Modules

  • Packages

  • pip

  • try

  • except

  • finally

Class 13 – File Handling

  • Read Files

  • Write Files

  • CSV Files

  • JSON Files

Class 14 – Object-Oriented Programming

  • Class

  • Object

  • Constructor

  • Instance Variables

  • Methods

Class 15 – Python Practice & Mini Project

  • Revision of Python Fundamentals

  • Problem Solving

  • Debugging


Tuesday, 7 July 2026

๐Ÿš€ Day 83/150 – Find Common Keys in Dictionaries in Python

 

๐Ÿš€ Day 83/150 – Find Common Keys in Dictionaries in Python

Dictionaries are one of Python's most powerful data structures. Sometimes you need to compare two dictionaries and identify the keys they have in common. Python provides several easy and efficient ways to accomplish this.

In this post, we'll explore four different methods to find common keys between dictionaries.


Method 1 – Using Set Intersection (&)

The easiest way is to compare the dictionary keys using the intersection operator.

dict1 = {"name": "John", "age": 20, "city": "Delhi"} dict2 = {"age": 25, "city": "Mumbai", "country": "India"} common = dict1.keys() & dict2.keys() print(common)







Output:
{'age', 'city'}
Explanation:
  • keys() returns a view of dictionary keys.
  • The & operator finds keys present in both dictionaries.

Method 2 – Using intersection() Method

You can also use the intersection() method for better readability.

dict1 = {"a": 1, "b": 2, "c": 3} dict2 = {"b": 5, "c": 7, "d": 9} common = dict1.keys().intersection(dict2.keys()) print(common)




Output:

{'b', 'c'}

Explanation:
  • intersection() performs the same operation as &.
  • It returns a set of common keys.

Method 3 – Using a For Loop

Loop through one dictionary and check whether each key exists in the other.


dict1 = {"x": 10, "y": 20, "z": 30} dict2 = {"y": 100, "z": 200, "a": 300} for key in dict1: if key in dict2: print(key)






Output:
y
z

Explanation:

  • Iterate over the first dictionary.
  • Print keys that also exist in the second dictionary.

Method 4 – Taking User Input

Compare two user-defined dictionaries.

dict1 = {"apple": 5, "banana": 3, "mango": 7} dict2 = {"banana": 10, "orange": 4, "apple": 2} common = dict1.keys() & dict2.keys() print("Common Keys:", common)




Output:

Common Keys: {'apple', 'banana'}

Explanation:
  • Works with any dictionaries.
  • Returns only the keys that appear in both.

Comparison of Methods

MethodBest For
Set Intersection (&)Fastest and shortest
intersection()Readable code
For LoopLearning and custom logic
User DictionaryReal-world dictionary comparison

๐Ÿ”ฅ Key Takeaways

✅ Dictionary keys can be compared using set operations.

✅ The & operator is the shortest and fastest way to find common keys.

✅ intersection() offers the same functionality with clearer syntax.

✅ A for loop is useful when additional conditions or processing are required.

✅ Finding common keys is useful in data comparison, configuration matching, and API response validation.

5 Useful Python WiFi Projects Every Beginner Should Try

 Python makes it incredibly easy to interact with your computer's networking features. Whether you're learning automation, networking, or system administration, these WiFi-related projects are practical, beginner-friendly, and fun to build.

In this blog, we'll explore five useful Python scripts that use Windows' built-in netsh command to retrieve WiFi information. These examples are intended for educational and system administration purposes.


1. WiFi Signal Strength Checker

Knowing your WiFi signal strength can help you identify weak connections and determine the best place to work or stream content.

Python Code

import subprocess

output = subprocess.check_output(
"netsh wlan show interfaces",
shell=True
).decode()

print(output)

How It Works

  • Uses Python's subprocess module.
  • Executes the Windows command:

    netsh wlan show interfaces
  • Displays detailed information about the currently connected WiFi network, including signal quality, SSID, radio type, and connection state.

Applications

  • Monitor WiFi signal quality.
  • Troubleshoot slow connections.
  • Learn Windows networking commands.



2. WiFi Profile Lister

Windows stores the names of WiFi networks you've connected to. This script displays those saved profiles.

Python Code

import subprocess

profiles = subprocess.check_output(
"netsh wlan show profiles",
shell=True
).decode()

print(profiles)

How It Works

The command

netsh wlan show profiles

lists every WiFi profile stored on your Windows computer.

Applications

  • View saved WiFi networks.
  • Clean up unused profiles.
  • Learn about Windows WiFi management.



3. WiFi Connection Status

Need to know whether your computer is currently connected to WiFi? This simple script provides the answer.

Python Code

import subprocess

status = subprocess.check_output(
"netsh wlan show interfaces",
shell=True
).decode()

print(status)

What You'll See

The output includes:

  • Connection status
  • Current SSID
  • Signal strength
  • Authentication type
  • Channel number
  • Receive and transmit rates

Applications

  • Create a network monitoring tool.
  • Detect connection issues.
  • Build desktop utilities.



4. WiFi SSID Finder

Sometimes you only need the name of the currently connected WiFi network. This script extracts the SSID from the command output.

Python Code

import subprocess

result = subprocess.check_output(
"netsh wlan show interfaces",
shell=True
).decode()

for line in result.split("\n"):
if "SSID" in line and "BSSID" not in line:
print(line)

How It Works

The script:

  1. Executes the Windows networking command.
  2. Reads each line of the output.
  3. Finds the line containing SSID.
  4. Ignores BSSID, which refers to the access point's MAC address.

Applications

  • Network-aware automation.
  • Desktop widgets.
  • Logging the connected WiFi network.



5. WiFi Adapter Information

This script retrieves detailed information about your wireless network adapter.

Python Code

import subprocess

adapter = subprocess.check_output(
"netsh wlan show drivers",
shell=True
).decode()

print(adapter)

Information Displayed

You'll see details such as:

  • Adapter name
  • Driver version
  • Manufacturer
  • Supported WiFi standards
  • Authentication methods
  • Cipher support
  • Hosted network capability

Applications

  • Check adapter compatibility.
  • Verify driver installation.
  • Learn about wireless hardware.



Requirements

These examples work on:

  • Windows 10
  • Windows 11
  • Python 3.x

No external Python libraries are required because they rely on Python's built-in subprocess module.

Install Python from:

https://python.org

Why Learn WiFi Automation with Python?

Working with WiFi information using Python helps you understand:

  • Python automation
  • Windows command-line tools
  • System administration
  • Networking fundamentals
  • Device diagnostics

These small projects are excellent stepping stones toward building larger networking applications.


Final Thoughts

Python is a powerful language for automating everyday networking tasks. With just a few lines of code, you can inspect WiFi profiles, check signal strength, monitor your connection, identify the current SSID, and retrieve adapter information.

These beginner-friendly projects are practical, easy to understand, and can be expanded into more advanced networking tools as your Python skills grow.

Happy Coding! ๐Ÿš€

Popular Posts

Categories

100 Python Programs for Beginner (119) AI (303) Android (25) AngularJS (1) Api (7) Assembly Language (2) aws (31) Azure (12) BI (10) Books (275) Bootcamp (12) C (78) C# (12) C++ (83) cloud (1) Course (87) Coursera (300) Cybersecurity (32) data (9) Data Analysis (39) Data Analytics (27) data management (16) Data Science (388) Data Strucures (23) Deep Learning (191) Django (16) Downloads (3) edx (21) Engineering (15) Euron (30) Events (7) Excel (21) Finance (10) flask (4) flutter (1) FPL (17) Generative AI (75) Git (12) Google (53) Hadoop (3) HTML Quiz (1) HTML&CSS (48) IBM (43) IoT (3) IS (25) Java (99) Leet Code (4) Machine Learning (344) Meta (24) MICHIGAN (5) microsoft (13) Nvidia (8) Pandas (14) PHP (20) Projects (34) Python (1401) Python Coding Challenge (1187) Python Mathematics (4) Python Mistakes (51) Python Quiz (565) Python Tips (23) Questions (3) R (72) React (7) Scripting (3) security (4) Selenium Webdriver (4) Software (20) SQL (52) Udemy (18) UX Research (1) web application (11) Web development (9) web scraping (3)

Followers

Python Coding for Kids ( Free Demo for Everyone)