Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 37 additions & 35 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 005 for loops and the range() function
# For Loop with Range.
# for Number in range (1, 11, 3)
# print (number)

# Using the for loob with the range function.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# for Loop with Range.
for Num in range(0, 50, 10):
print(Num)
print("\n")
for Nu1m in range(0, 30, 3):
print(Nu1m)
print("\n")
for Nu2m in range(0, 500, 5):
print(Nu2m)
# Here is our current example
total = 0
for number in range(0, 101):
total += number
print(f"The total number is={total}")
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 006 [Interactive Coding Exercise] Adding Even Numbers

# Instruction.

- You are going to wirte a programm that calculate the sum of all the even numbers from 1 to 100 including 1 and 100.

# HINT
- There is more than one answer to this problem , but you have to follow the Rang() Method to solve it.

# Follow Me here:-
- Linked in >> https://www.linkedin.com/in/hammad-ibrahim-0b33bb223/
- GitHub >> https://github.com/hammad-ibrahim
- X or Twitter >> https://twitter.com/dev_hammad_ops
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# calculating all the even numbers from 1 to 100 including them
total = 0
for nums in range(2, 101, 2):
# print(nums)
total += nums
print(total)
total2 = 0
for Num in range(1, 101):
if Num % 2 == 0:
total2 += Num
print(f"Here is the same output with new way to sole the problem \n {total2}")

# Job well done
# Hammad
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Writing a programm to the FIZZ BUZZ game.
- How is that ??
# Your Programm Should:-
- Print each Number from 1 to 100 in turn.
- when the number is divisable # by 3 # insted of priniting the number should print *FIZZ*.
- when the number is divisable # by 5 # insted of printing the number should print *BUZZ*.
- when the number is divisable # by 5,3,15# then insted of the number should print * FIZZBUZZ*.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# FIZZBUZZ
total = 0
for val in range(1, 101):
# Range of our programm
if val % 3 == 0 and val % 5 == 0:
# division By %3 and %5 and
print("FIZZyBuzz")
elif val % 5 == 0:
# DIvision By %5
print("BUZZ")
elif val % 3 == 0:
# Divison By 3
print("FIZZ")
else:
print(val)
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Welcom to the pypassword generator.
# Password generator.

# import the random Function.
import random
Letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S']
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
Sympols = ['+', '/', '*', '!', '@', '#', '$', '%', '^', '&', '-']
print("Welcome to the PypasswordGenerator!\n \n ")

nr_letters = int(input(f"How many letters?? \n"))
nr_sympols = int(input(f"How Many sympols\n"))
nr_numbers = int(input(f"how many numbers \n"))
# Here is the magica of our programe .
# EasyPAssword
# for char in range(1, nr_letters + 1):
# for char in range(1, nr_numbers + 1):
# password += str(random.choice(numbers))
# for char in range(1, nr_sympols + 1):
# password += random.choice(Sympols)

# print(f"Here Is your Password :\n{password}")

# Hard Way
password_list = []

for char in range(1, nr_sympols + 1):
password_list += random.choice(Sympols)
for char in range(1, nr_numbers + 1):
password_list += str(random.choice(numbers))
for char in range(1, nr_letters + 1):
password_list += random.choice(Letters)
print(password_list)
random.shuffle(password_list)
print(password_list)
password = ""
for char in password_list:
password += char
print(f"Here is your password : \n {password}")
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Function in Python.
# Defining Function in Python
- Do This.
- Then DO This.
- Finally Do This.

# How to do that thing called function.
- The first step is actually define the function, to specifiy what it should do.
we do that by first using keyword (DEF) and then give our function.
Give it a name like # def FUnciton():
- Calling that Fuction out to the world.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


# we are going to Use here not our current preference for the coding of def function section .
# we are going to use Google Python automation in that part.
# 100 Day in python will be followed in further lessons
Loading