GPS_Tech
424 subscribers
689 photos
63 videos
12 files
493 links
Coding
Download Telegram
πŸš€ My Journey Is Beginning

Today, I begin my journey in:
β€’ Python programming
β€’ Machine Learning
β€’ Deep Learning
β€’ And other modern technologies

This channel will document my progress from fundamentals to real-world systems.
Learning, building, failing, improving β€” consistently.

The goal is not shortcuts.
The goal is mastery.

Day 1 starts now.

@gpaspace_tech
#Python #MachineLearning #DeepLearning #LearningInPublic
πŸ”₯2
Day 2: Python Lists & CLI Logic πŸš€


1️⃣ Command Line Database Setup I built a script that uses sys.argv to accept commands. It dynamically asks for table details and stores column names in a list.

Python

import sys

# Checking for command line arguments
if len(sys.argv) < 2:
print('Usage: python lists.py create_db')
elif sys.argv[1] == 'create_db':
table_cols = []
table_name = input('Enter table name: ')
cols_num = int(input('Enter number of columns: '))
for i in range(cols_num):
col_name = input(f'Enter the column name {i+1}: ')
table_cols.append(col_name)
print(f"Columns Created: {table_cols}")
else:
print('Invalid command')


2️⃣ List Iteration (Class Roster) Practicing how to loop through lists to create formatted output. This is a "Pythonic" way to handle data without needing complex index numbers.

Python

class_name = "Math 101"
students = ["Alice", "Bob", "Charlie"]

print(f"Class \"{class_name}\" Roster:")
for student in students:
print(f"- {student}")


3️⃣ List Slicing Power Learning how to extract specific parts of a list using index ranges. Slicing is one of Python’s most powerful features!

animals = ["cat", "dog", "rabbit", "hamster", "parrot", "fish"]

print(animals[0:2]) # Output: ['cat', 'dog'] (Start at 0, stop before 2)
print(animals[1:]) # Output: ['dog', 'rabbit', 'hamster', 'parrot', 'fish'] (From 1 to end)
print(animals[:3]) # Output: ['cat', 'dog', 'rabbit'] (From start to 3)
print(animals[-3:]) # Output: ['hamster', 'parrot', 'fish'] (Last three items)

4️⃣ List Slicing Power (Level: Advanced) ⚑️

Python slicing follows the rule: [start : stop : step]. I experimented with different combinations, including negative steps to reverse parts of the list!

animals = ["cat", "dog", "rabbit", "hamster", "parrot", "fish"]

# Basic Slicing
print(animals[0:2]) # ['cat', 'dog'] (Start at 0, stop before 2)
print(animals[:3]) # ['cat', 'dog', 'rabbit'] (First three)
print(animals[-3:]) # ['hamster', 'parrot', 'fish'] (Last three)

# Slicing with Step [start:stop:step]
print(animals[::2]) # ['cat', 'rabbit', 'parrot'] (Every 2nd item)
print(animals[1:5:2]) # ['dog', 'hamster'] (From index 1 to 5, skipping every other)
print(animals[::3]) # ['cat', 'hamster'] (Every 3rd item)

# The Reverse Tricks
print(animals[::-1]) # ['fish', 'parrot', 'hamster', 'rabbit', 'dog', 'cat'] (Reverse entire list)
print(animals[-1:-4:-1]) # ['fish', 'parrot', 'hamster'] (Reverse last 3)
print(animals[3:0:-1]) # ['hamster', 'rabbit', 'dog'] (Reverse from index 3 down to 1)

# Full Copy
print(animals[:]) # Full copy of the list

@gpspace_tech
#Day2 #PythonJourney #PythonCLI #LearningInPublic
#Linkedein #ML #DL #Machine #Learing #Cursor #Python
#Masrer
❀2
πŸ”₯ Python Tip of the Day β€” List Methods

append() ➜ Add items
remove() ➜ Delete items
count() ➜ How many?
index() ➜ Where is it?
extend() ➜ Add many
pop() ➜ Remove by index
reverse()➜ Flip the list
sort() ➜ Order the list

numbers = [3, 4, 5, 6]
nums = [6, 5, 4, 2, 3, 1]

numbers.append(7) ➜ [3, 4, 5, 6, 7]
numbers.clear() ➜ []
numbers.copy() ➜ [3, 4, 5, 6]
[3,4,5,6,3].count(3) ➜ 2
numbers.extend("GPS") ➜ [3,4,5,6,'G','P','S']
numbers.index(4) ➜ 1
numbers.insert(2,'B') ➜ [3,4,'B',5,6]
numbers.pop(3) ➜ [3,4,5]
numbers.remove(4) ➜ [3,5,6]
numbers.reverse() ➜ [6,5,4,3]
nums.sort() ➜ [1,2,3,4,5,6]


Keep learning. Keep building. πŸš€

#Python #CodingTips #PythonForBeginners #CodeEveryday
#ProgrammingLife #MachineLearning #DeepLearning #AI
#TechEthiopia @gpspace_tech
Day 3 : Match statement
🟒 MATCH STATEMENT IN PYTHON (Deep Explanation)

The ***match statement*** in Python is like a more advanced version of if-elif-else, introduced in Python 3.10.

It allows you to compare a value against several patterns and run code depending on which pattern matches. Think of it as a β€œswitch-case” on steroids.

1️⃣ Basic Syntax
match variable:
case pattern1:
# do something
case pattern2:
# do something else
case _:
# default case (like else)


variable β†’ the value you want to check

case pattern: β†’ the pattern you want to match

(_) β†’ wildcard, matches anything not matched before (like default)

2️⃣ Simple Example (Number Matching)
x = 2

match x:
case 1:
print("One")
case 2:
print("Two")
case 3:
print("Three")
case _:
print("Other number")

Output:
Two


The program checks each case one by one. When x == 2, it executes that block and skips the rest.

3️⃣ Matching Multiple Values

You can match several values in one case using | (OR operator):
day = "Saturday"

match day:
case "Saturday" | "Sunday":
print("Weekend")
case _:
print("Weekday")

Output:
Weekend

4️⃣ Matching Types & Structures

match can also check types or patterns in data structures.

a) Matching a list
numbers = [1, 2, 3]

match numbers:
case [1, x, 3]:
print(f"Second number is {x}")
case _:
print("No match")

Output:
Second number is 2


Here [1, x, 3] is a pattern. x takes the middle value.

b) Matching dictionaries
person = {"name": "Eba", "age": 20}

match person:
case {"name": name, "age": age}:
print(f"Name: {name}, Age: {age}")

Output:
Name: Eba, Age: 20


5️⃣ Matching Classes (Object-Oriented)

```class Point:
def init(self, x, y):
self.x = x
self.y = y

p = Point(1, 2)

match p:
case Point(x=0, y=0):
print("Origin")
case Point(x, y):
print(f"Point at ({x},{y})")

Output:
Point at (1,2)```

#AI #day3 #GPSPACE #EAII #gps #Nasa #GPSPACE #MachineLearning
#python #match #list #dict #other #INSA #EAII #trump
@gpspace_tech
πŸ“˜ Properties of Algorithms β€” Foundation of Computer Science

An algorithm is a step-by-step procedure used to solve a problem. For an algorithm to be correct and useful, it must have the following important properties:

1️⃣ Finiteness
The algorithm must stop after a finite number of steps. It cannot run forever.

2️⃣ Definiteness (No Ambiguity)
Each step must be clear, precise, and well-defined. The computer must understand exactly what to do.

3️⃣ Sequential (Order)
Steps must be executed in the correct logical order to produce the correct result.

4️⃣ Correctness
The algorithm must produce the correct output for every valid input.

5️⃣ Language Independence
An algorithm is not tied to any programming language. It can be implemented in Python, C, Java, or any language.

6️⃣ Feasibility
Each step must be practical and possible to execute with available resources.

7️⃣ Effectiveness
Every instruction must be simple and executable by a computer in a finite time.

8️⃣ Efficiency
The algorithm should use minimum time and memory. Efficient algorithms are faster and more scalable.

9️⃣ Precision
Each instruction must be exact and specific, with no confusion.

πŸ”Ÿ Simplicity
The algorithm should be easy to understand, implement, and maintain.

Additional Properties:

βœ”οΈ Input β€” Accepts zero or more inputs
βœ”οΈ Output β€” Produces at least one output
βœ”οΈ Generality β€” Solves a general problem, not just one specific case

πŸš€ Key Insight:
Data Structures store data. Algorithms process data. Together, they form the foundation of all software, artificial intelligence, and modern computing.

πŸ’‘ Master algorithms, and you master problem-solving.

#Algorithms
#DataStructures
#ComputerScience
#Programming
#SoftwareEngineering
#FutureEngineers
#Python

@gpspace_tech