Programming Classes
257 subscribers
35 photos
1 video
12 files
24 links
Tech For better Future!
Download Telegram
Hello, students
Due to some reasons our today's session is postponed for tomorrow.
We'll have a long session tomorrow starting from 2:00 - 6:00.
Make your self ready for the tomorrow's learning session.
๐Ÿ”ฅ2๐Ÿ‘1
Today is a Crucial Lesson so Missing class today may cost you dearly.

2:00 (Local Time)
๐Ÿ‘1
#Basic_Computer


For basic computer students our class is in the afternoon 7:30 -9:00 local time. Don't miss it.
๐Ÿ‘3
five examples for each type of loop in Python:

1\. For Loop:
# Example 1: Iterating over a string
for letter in "Python":
print(letter)

# Example 2: Iterating over a tuple
fruits = ("apple", "banana", "cherry")
for fruit in fruits:
print(fruit)

# Example 3: Iterating over a dictionary
person = {"name": "John", "age": 30, "country": "USA"}
for key, value in person.items():
print(key, value)

# Example 4: Iterating over a list of numbers and finding the sum
numbers = [1, 2, 3, 4, 5]
sum = 0
for num in numbers:
sum += num
print("The sum is:", sum)

# Example 5: Iterating over a list and printing the index and value of each element
fruits = ["apple", "banana", "cherry"]
for index, fruit in enumerate(fruits):
print(index, fruit)
2\. While Loop:
# Example 1: Printing numbers from 1 to 10 using while loop
num = 1
while num <= 10:
print(num)
num += 1

# Example 2: Finding the factorial of a number using while loop
num = 5
factorial = 1
while num > 0:
factorial *= num
num -= 1
print("The factorial is:", factorial)

# Example 3: Removing all occurrences of an element from a list using while loop
numbers = [1, 2, 3, 2, 4, 2, 5]
element = 2
while element in numbers:
numbers.remove(element)
print("The list after removing all occurrences of", element, "is:", numbers)

# Example 4: Printing numbers in reverse order using while loop
num = 10
while num >= 1:
print(num)
num -= 1

# Example 5: Finding the sum of digits of a number using while loop
num = 12345
sum = 0
while num > 0:
digit = num % 10
sum += digit
num //= 10
print("The sum of digits is:", sum)
3\. Nested Loops:
# Example 1: Printing multiplication table using nested loops
for i in range(1, 11):
for j in range(1, 11):
print(i, "*", j, "=", i*j)
print()

# Example 2: Finding all pairs of elements from two lists whose sum is even using nested loops
list1 = [1, 2, 3]
list2 = [4, 5, 6]
for x in list1:
for y in list2:
if (x+y) % 2 == 0:
print("(", x, ",", y, ")")

# Example 3: Printing a pattern using nested loops
for i in range(1, 6):
for j in range(1, i+1):
print("*", end="")
print()

# Example 4: Finding the common elements between two lists using nested loops
list1 = [1, 2, 3, 4]
list2 = [3, 4, 5, 6]
common = []
for x in list1:
for y in list2:
if x == y:
common.append(x)
print("The common elements are:", common)

# Example 5: Printing all possible combinations of a list using nested loops
list1 = [1, 2, 3]
for i in range(len(list1)):
for j in range(i+1, len(list1)):
print("(", list1[i], ",", list1[j], ")")
4\. Range Loop:
# Example 1: Printing even numbers using range loop
for num in range(0, 11, 2):
print(num)

# Example 2: Printing odd numbers using range loop
for num in range(1, 10, 2):
print(num)

# Example 3: Printing numbers in reverse order using range loop
for num in range(10, 0, -1):
print(num)

# Example 4: Finding the sum of numbers using range loop
numbers = [1, 2, 3, 4, 5]
sum = 0
for num in range(len(numbers)):
sum += numbers[num]
print("The sum is:", sum)

# Example 5: Printing the ASCII values of characters using range loop
for char in range(ord('a'), ord('z')+1):
print(chr(char), "=", char)
5\. List Comprehension:
`
# Example 1: Squaring numbers using list comprehension
numbers = [1, 2, 3, 4, 5]
squares = [num**2 for num in numbers]
print("The squares are:", squares)

# Example 2: Filtering even numbers using list comprehension
numbers = [1, 2, 3, 4, 5]
even = [num for num in numbers if num % 2 == 0]
print("The even numbers are:", even)

# Example 3: Removing duplicates from a list using list comprehension
numbers = [1, 2, 3, 2, 4, 2, 5]
unique = list(set([num for num in numbers]))
print("The list after removing duplicates is:", unique)

# Example 4: Converting a list of strings to uppercase using list comprehension
fruits = ["apple", "banana", "cherry"]
uppercase = [fruit.upper() for fruit in fruits]
print("The fruits i
๐Ÿ‘1
n uppercase are:", uppercase)

# Example 5: Finding the length of each word in a sentence using list comprehension
sentence = "The quick brown fox jumps over the lazy dog"
lengths = [len(word) for word in sentence.split()]
print("The lengths of words are:", lengths)
`

Sure, here are five examples of if statements in Python:

1. Checking if a number is positive or negative:
num = -5
if num >= 0:
print("The number is positive")
else:
print("The number is negative")


2. Checking if a number is even or odd:
num = 7
if num % 2 == 0:
print("The number is even")
else:
print("The number is odd")


3. Checking if a string is empty or not:
string = ""
if len(string) == 0:
print("The string is empty")
else:
print("The string is not empty")


4. Checking if a number is divisible by both 3 and 5:
num = 15
if num % 3 == 0 and num % 5 == 0:
print("The number is divisible by both 3 and 5")
else:
print("The number is not divisible by both 3 and 5")


5. Checking if a person is eligible to vote based on their age:
age = 17
if age >= 18:
print("You are eligible to vote")
else:
print("You are not eligible to vote yet")
Python notes
๐ŸŒFor Web Development Students๐ŸŒ

โœจ Please Try creating HTML only Websites like the one this video.

๐Ÿ’ŽNext Friday we will learn about:
โœ…Div
โœ…Span
โœ… Class and ID
โœ… connecting CSS to HTML using External
โœ… Some CSS codes

https://youtu.be/hKsSgU5b0Gw?si=8SwsDKtTmnai-y8L
Please open Telegram to view this post
VIEW IN TELEGRAM
โค3๐Ÿ‘2๐Ÿ”ฅ1
For Web development Students

โœ…Be informed that we don't have class today and follow this channel as we will have projects through this chat.
Please open Telegram to view this post
VIEW IN TELEGRAM
Forwarded from Crypto News (๐“‘๐“ฎ๐“ท๐“ช๐“ผ)
Students who want to study the following courses online please register at the link below.
๐Ÿ”ฐCyber Security
Learn to safeguard systems and data from ever-evolving digital threats.

Upon completion of the above courses, you will receive a Certificate from Google. Only a few students left so Hurry up and register. Once you have registered, you will only be required to pay 200 ETB when you receive an email that your registration has been successful. Registration ends January 6th and Classes begin January 8th.
โœ… To register ๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡

https://docs.google.com/forms/d/e/1FAIpQLSetwkk6s-7zyZUC85UJPIUWnQjdV47aEDq-ULATLAmuRhFv2A/viewform?usp=sf_link
๐Ÿ‘1
We are informed that most of the students have a tutorial class today. Therefore, our today's class is postponed. Enjoy your time and merry Christmas.

Please follow up for more video lesson and notes to be posted on this channel.
๐Ÿ”ฅ1
For Web Development Class Students Only

Be informed that we will have Crucial Class Jan 7 at 10:00 PM (Local Time).

We will develop some projects on our today's lesson so try to watch below Videos .

https://youtu.be/cHv-ZYVm1Dg?si=CFNqaYmMxhtdKeDK

https://youtu.be/zqWOMO22CvE?si=YF8o1_KKUCPaWbAu

Please Share this Information For Your friends since this is a crucial class it will be hard to pass to other projects.
โค2๐Ÿ‘1
Hello everybody,
Due to the final exam preparations we had closed our classes for over a month, coming semester we will go harder to finish the classes before mid exam. So do review what you learned during your break. Till then we will learn with some videos which I will post on here. Don't forget to tell each other.

Have a blast one.
๐Ÿ‘3โค1
#python
Everyone get ready we will have a video lesson posted after now. Make sure you watch the entire video.
๐Ÿ‘2
Programming Classes
https://youtu.be/_uQrJ0TkZlc?si=-9WIXYTy4aGyrp2q
#python
Every single one of you must at least watch 4 hours of this video
โค2
Media is too big
VIEW IN TELEGRAM
#python
You can download it from here too
๐Ÿ‘2๐Ÿ‘1
#Web_Devlopment

Hello Students, As we all know we have stopped our regular class due to different Exams including the Final exam. So to cover missed classes we will have some classes Next semester at The beginning. Also Since we have covered the basics we will change our technique and follow PBL(Project Based Learning) strategy. So from the below poll please vote at maximum (not greater than) three Projects we will do and the top Voted Three projects will be done in class and the others will be given as a project for you. So please make yourself ready for our next sessions by reviewing what we learned with video I'm gonna send you Next.
๐Ÿ”ฅ3