Skip to content

Instantly share code, notes, and snippets.

View saaeiddev's full-sized avatar
🎯
Focusing

Amir Saeid Dehghan saaeiddev

🎯
Focusing
View GitHub Profile
@saaeiddev
saaeiddev / class.py
Created September 14, 2022 20:20
Class and object in Python
class Human():
def __init__(self, name, gender, eye_color, hair, height):
self.name = name
self.gender = gender
self.eye_color = eye_color
self.hair = hair
self.height = height
h1 = Human("saeid", "male", "brown", "black", "180")
print(h1)
@saaeiddev
saaeiddev / requests.py
Created September 14, 2022 20:35
requests library
import requests
url = "https://www.saeidmedia.ir"
data = requests.get(url)
print(data)
print(data.text)
@saaeiddev
saaeiddev / 10.py
Created September 15, 2022 12:39
My_List = [10, 14, True, False, 2.4, "ali"]
for item in My_List:
if type(item) == int and item > 10: # for --> loop
print("there is a integer data type and it is bigger than 10")
print(item)
for item in My_List:
if type(item) == float and item > 2:
print(item)
@saaeiddev
saaeiddev / pandas series.py
Created September 18, 2022 13:33
pandas series
import pandas as pd
# pandas series
a = [1, 7, 2]
myvar = pd.Series(a)
print(myvar)
@saaeiddev
saaeiddev / pandas DataFrame.py
Created September 18, 2022 13:36
pandas DataFrame
import pandas as pd
# pandas DataFrame
data = {
"prices":[300 , 600 , 900] ,
"duration":[10 , 20 , 30]
}
@saaeiddev
saaeiddev / matplotlib.py
Created September 18, 2022 14:23
matplotlib charts
import matplotlib.pyplot as plt
import numpy as np
xpoints = np.array([3 , 6])
ypoints = np.array([7 , 12])
zpoints = np.array([5 , 14])
plt.plot(xpoints , ypoints , zpoints)
plt.show()
List3 = ["amir", 3, 6, 9, True]
List4 = [2.2 , 3.2]
Number = int(input("please enter the number : "))
if Number > 10:
List3.append(Number)
print(List3)
elif Number < 10:
for item in List3:
List3.remove(item)
@saaeiddev
saaeiddev / health.py
Created September 19, 2022 20:51
health
Name = input("please enter your name : ")
print("welcome" , Name)
Age = int(input("please enter your Age : "))
if Age > 20:
print("you can enter ")
elif Age < 20:
print("you cant enter")
else:
@saaeiddev
saaeiddev / health2.py
Created September 24, 2022 15:41
health2
name = "amir saeid"
age = 18
weight = 80.88
print(weight)
print(age)
name = str(input("please enter your name : "))
print("welcome" + name + "!")
@saaeiddev
saaeiddev / range.py
Created September 26, 2022 18:24
range
for i in range(5 , 25):
if i > 10 and i < 15:
print(i , i * 2)
print("done")
elif i > 19 and i < 21:
print(i , i + 2)
print("this")
else:
print("try again !")