Skip to content

Commit 441d357

Browse files
committed
First Commit
0 parents  commit 441d357

File tree

532 files changed

+88878
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

532 files changed

+88878
-0
lines changed

Diff for: .idea/PythonBootcamp.iml

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/misc.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/workspace.xml

+679
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: 06Numbers_Operators/IntFloat.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
print(type(8))
2+
print(type(8.0))
3+
4+
x, y = 10, 5
5+
print(x, y)
6+
7+
x, y = y, x
8+
print(x, y)

Diff for: 06Numbers_Operators/MathBasics.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
divisor, divident = 2, 1
2+
ans = divident / divisor
3+
print(ans)
4+
a, b, c, d = 2, 3, 4, 5
5+
6+
ans = a + b * c / d
7+
print(ans)
8+
9+
# ** is power
10+
exp = a ** b
11+
print(exp)
12+
13+
mod = b % a
14+
print(mod)
15+
16+
# // returns integer division result
17+
intDiv = d // a
18+
# / returns float division result
19+
div = d / a
20+
print(div, intDiv)
21+
22+
23+
'''
24+
PEMDAS
25+
Parentheses
26+
Exponents
27+
Multiplication
28+
Division
29+
Addition
30+
Subtraction
31+
'''

Diff for: 07Variables_Strings/01variables.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
num = 99
2+
print(num * 2)
3+
print(num)
4+
5+
num *= 2
6+
print(num)
7+
8+
#Naming Convension
9+
#snake_case
10+
snake_case = 10
11+
12+
#for constants
13+
CAPITAL_SNAKE_CASE, PI = 100, 3.14159603
14+
#for class
15+
class UpperCamelCase:
16+
pass
17+
18+
#dunders ('d'ouble 'unders'cores) means something u shouldn't touch

Diff for: 07Variables_Strings/02data_types.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'''
2+
bool
3+
int
4+
str
5+
list
6+
dict
7+
'''
8+
9+
#bool
10+
is_active = True
11+
inactive = not is_active
12+
print(is_active)
13+
print(not is_active)
14+
print(inactive)
15+
print(not inactive)
16+
17+
#str
18+
some_string = "hello i am srting!"
19+
print(some_string)
20+
21+
#list
22+
my_number = [1, 2, 4, 3]
23+
print(my_number)
24+
print(my_number[2])
25+
26+
#dict
27+
my_name = {'first_name': "Humayun", 'last_name': "Kabir"}
28+
print(my_name)
29+
print(my_name['first_name'])
30+
print(my_name['last_name'])

Diff for: 07Variables_Strings/03dynamic_data_typing.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
game_over = True
2+
print(game_over)
3+
4+
game_over = "Yes, it's over!"
5+
print(game_over)
6+
7+
game_over = 22/7
8+
print(game_over)
9+
10+
#None is nothing
11+
game_over = None
12+
print(game_over)
13+
print(type(game_over))

Diff for: 07Variables_Strings/04strings.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
single_qoute = 'hello'
2+
double_qoute = "hello"
3+
print(single_qoute)
4+
print(double_qoute)
5+
6+
qoute = 'he said, "hello there!"'
7+
print(qoute)
8+
qoute = "he said, 'hello there'"
9+
print(qoute)
10+
11+
qoute = "he said, \"hello there!\""
12+
print(qoute)
13+
14+
#string concatenation
15+
username = "mhkm"
16+
msg = "Hello " + username
17+
print(msg)
18+
19+
#Formatting String
20+
name = "Humayun"
21+
msg = f"Hello Mr. {name} Welcome!"
22+
msg2 = "Hello Mr. {} Welcome!".format(name)
23+
print(msg)
24+
print(msg2)

Diff for: 07Variables_Strings/05convert_data_type.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
intx = 10
2+
print(type(intx))
3+
4+
floatx = float(intx)
5+
print(floatx)

Diff for: 07Variables_Strings/06input.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
print("How many KM did you cycle today?")
2+
# by default input return string input
3+
kms = float(input())
4+
miles = kms/1.61
5+
# precisions
6+
miles = round(miles, 3)
7+
print(f"Your {kms} KM is {miles} Miles")

Diff for: 08Boolean_Conditional/01user_input.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
print("What's your favorite color?")
2+
color = input()
3+
print("Your color is: " + color)

Diff for: 08Boolean_Conditional/02if_condition.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name = "humayun"
2+
3+
if name is "humayun":
4+
print("First Name")
5+
elif name is "kabir":
6+
print("Last Name")
7+
else:
8+
print("Wrong Name")
9+
10+
name = "kabir"
11+
if name == "humayun":
12+
print("First Name")
13+
elif name == "kabir":
14+
print("Last Name")
15+
else:
16+
print("Wrong Name")

Diff for: 08Boolean_Conditional/03multi_elifs.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
print("Give a rating on my work(out of 5)!")
2+
rate = int(input())
3+
4+
if rate is 5:
5+
print("Excellent")
6+
elif rate is 4:
7+
print("Very Good")
8+
elif rate is 3:
9+
print("Good")
10+
elif rate is 2:
11+
print("Not Good")
12+
elif rate is 1:
13+
print("Bad")
14+
else:
15+
print("Rating should be in 1 to 5")

Diff for: 08Boolean_Conditional/04logical_operator.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
age, sex = 20, "Female"
2+
3+
if age > 18 and sex is "Female":
4+
print("Go and Get Marry")
5+
else:
6+
print("You don't have marry")

Diff for: 09RockPaperScissor/advanced.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import random
2+
3+
print("Rock...")
4+
print("Paper...")
5+
print("Scissor...")
6+
7+
options = ["rock", "papers", "scissors"]
8+
print("Enter Your Move:")
9+
me = input()
10+
11+
rand = random.randint(0, 2)
12+
pc = options[rand]
13+
14+
player_one = me
15+
player_two = pc
16+
17+
print(f"You Choose: {me}, PC choose {pc}")
18+
19+
if player_one == player_two:
20+
print("Draw")
21+
elif player_one == "rock":
22+
if player_two == "scissors":
23+
print("You WON!")
24+
elif player_two == "papers":
25+
print("PC WON!")
26+
elif player_one == "papers":
27+
if player_two == "rock":
28+
print("You WON!")
29+
elif player_two == "scissors":
30+
print("PC WON!")
31+
elif player_one == "scissors":
32+
if player_two == "rock":
33+
print("PC WON!")
34+
elif player_two == "papers":
35+
print("You WON")
36+
else:
37+
print("Something Wrong!")

Diff for: 09RockPaperScissor/basic_one.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
print("Rock...")
2+
print("Paper...")
3+
print("Scissor...")
4+
5+
player_one = input("Player 1, Make your move:")
6+
player_two = input("Player 2, Make your move:")
7+
8+
if player_one == player_two:
9+
print("Draw")
10+
elif player_one == "rock":
11+
if player_two == "scissors":
12+
print("Player 1 WON!")
13+
elif player_two == "papers":
14+
print("Palyer 2 WON")
15+
elif player_one == "papers":
16+
if player_two == "rock":
17+
print("Palyer 1 WON")
18+
elif player_two == "scissors":
19+
print("Palyer 2 WON")
20+
elif player_one == "scissors":
21+
if player_two == "rock":
22+
print("Palyer 2 WON")
23+
elif player_two == "papers":
24+
print("Palyer 1 WON")
25+
else:
26+
print("Something Wrong!")

Diff for: 10looping/01for_one.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name = "musa"
2+
3+
for char in name:
4+
print(char)
5+
6+
# range(a, b, c): >=a to < b, c is the weight of each step[optional]
7+
for number in range(-3, 5, 2):
8+
print(number)
9+
10+
prices = [10, 12, 15, 9, 11, 13]
11+
12+
for price in prices:
13+
print(price)
14+
15+
for _ in range(4):
16+
print("lol")

Diff for: 10looping/02while.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
val = 1
2+
3+
while val < 20:
4+
print(val)
5+
val += 4
6+
7+
print("what's the password?")
8+
msg = input()
9+
while msg != "lana":
10+
print("WRONG!")
11+
print("what's the password?")
12+
msg = input()
13+
print("CORRECT!")

Diff for: 10looping/03smile_pyramid_for.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
num = 7
2+
for times in range(num):
3+
for x in range(times):
4+
print("\U0001f600", end=' ')
5+
print()

Diff for: 10looping/04smile_pyramid_while.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
num = 1
2+
3+
while num < 7:
4+
x = 1
5+
while x <= num:
6+
print("\U0001f600", end=' ')
7+
x += 1
8+
print()
9+
num += 1

Diff for: 12lists/01list_one.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
my_list = ["musa", 25, True, 45.678]
2+
3+
print(my_list)
4+
print(len(my_list))
5+
6+
for item in my_list:
7+
print(item, end=' ')
8+
print()
9+
10+
r = range(1, 10)
11+
print(r)
12+
print(list(r))
13+
14+
colors = ["purple", "teal", "magenta", "blue"]
15+
16+
# iterate using for-loop
17+
for color in colors:
18+
print(color, end=' ')
19+
print()
20+
21+
# iterate using while loop
22+
x = 0
23+
while x < len(colors):
24+
print(colors[x], end=' ')
25+
x += 1

0 commit comments

Comments
 (0)