Saturday, June 13, 2020
create program Employee names in python


from Employee import Employee

employee1 = Employee("islam", 50, "codezilla", True)
employee2 = Employee("ibrahim", 60, "Facebook", False)


print(employee1.name, employee1.age, employee1.department, employee2.name, employee2.age, employee2.is_manager)

create classes in python


class Employee:
    def __init__(self, name, age, department, is_manager):
    self.name = name
self.age = age
self.department = department
self.is_manager = is_manager
class Student:
    def __init__(self, name, age, gpa, major, university_name):
    self.name = name
self.age = age
self.gpa = gpa
self.major = major
self.university_name = university_name
class Pussy:
    def __init__(self, zabour, terma, loun_ha, ka7baa):
    self.zabour = zabour
self.terma = terma
self.loun_ha = loun_ha
self.Ka7baa = ka7baa
create a program Employee from class Employee in python



from Employee import Employee

employee1 = Employee("islam", 50, "codezilla", True, 5, 1500)
employee2 = Employee("ibrahim", 60, "Facebook", False, 3.5, 500)


print(employee1.name, employee1.age, employee1.department, employee2.name, employee2.age, employee2.is_manager, employee1.is_excellent(), employee2.is_excellent())
  
print(employee1.salary)
employee1.bonus()
print(employee2.salary)
employee2.bonus()

create class Employee in python



class Employee:
    def __init__(self, name, age, department, is_manager, rating, salary):
    self.name = name
self.age = age
self.department = department
self.is_manager = is_manager
self.rating = rating # rating is from 1-5
self.salary = salary
def is_excellent(self):
    if self.rating >=4.5:
    return True
else:
        return False
def bonus(self):
    if self.age == 60:
   self.salary += 500
   print("salary increased to " +str(self.salary))
else:
   print("no bonus added, salary is still " +str(self.salary))
   
   10
create program suspect from class suspect in python





from PrisonArchive import Suspect

suspect1 = Suspect("vlad", "remoss", 40, "new york prison cell n°5", "killed 23 people in cold blood", 40, False)
suspect2 = Suspect("siros", "juma", 52, "new york prison cell n°2", "killed his grandmather for inhiritens ", 66, True)
suspect3 = Suspect("nimar", "kiras", 38, "new york prison cell n°9", "killed All his friends to get money for him self", 70, True)
suspect4 = Suspect("gibor", "pands", 56, "new york prison cell n°12", "killed his family", 50, False)
suspect5 = Suspect("topako", "kardan", 46, "new york prison cell n°22", "killed 2000 people in cold blood and kidnappied little girls fo fun and he killed them for sport", 150, True)

print(suspect1.high__level())
suspect1.prison__years()

print(suspect2.high__level())
suspect2.prison__years()

print(suspect3.high__level())
suspect3.prison__years()

print(suspect4.high__level())
suspect4.prison__years()

print(suspect5.high__level())
suspect5.prison__years()

create class suspect in python


class suspect:
   def __init__(self, last_name, first_name, age, adsresse, crime, prison_years, high_level):
       self.last_name = last_name
   self.first_name = first_name
   self.age = age
   self.adsresse = adsresse
   self.crime = crime
   self.prison_years = prison_years
   self.high_level = high_level
   
   
   
    def prison_years(self):
    if self.prison_years >=30:
    return True
else:
        return False
def high_level(self):
    if self.prison_years >=30:
   self.high_level = True
   print("the suspect is high level dongerous ")
else:
   print("the suspect is not high level dongerous " )
Say Hi in python function


def say_hi(name, age):
    print("hello " +name+ " your age is " +str(age))
print("fist")
say_hi("hussin", 35)
print("second")

Function Cube in python


def cube(num):
    return num*num*mum
def sum(num1, num2):
    return num1_num2
print(sub(7, 4))

create class user in python


class User:
  pass
user1 = User()
user1.first_name = "Dave"
user1.last_name = "Bowman"

print(user1.first_name)
print(user1.last_name)

user2 = User()
user2.first_name = "Frank"
user2.last_name = "Poole"

print(first_name, last_name)
print(user1.first_name, user1.last_name)
print(user2.first_name, user2.last_name)

user1.age = 37
user2.favorite_book = "2001: A Space Odyssey"

print(user1.age)
print(user2.age)

create class in python


class User:
  def __init__(self, full_name, birthday):
   self.name = full_name
   self.birthday = birthday # yyyymmdd
   
   # Extract first and last names
   name_pieces = full_name.split(" ")
   self.first_name = name_pieces[0]
   self.last_name = name_pieces[-1]
   
   
user = User("Dave Bowman", "19710315")
print(user.name)
print(user.first_name)
print(user.last_name)
print(user.birthday)

create prompt hello in python


from tkinter import *

root = Tk()

# creating a Label widget
myLabel = Label(root, text="hello world!")
myLabe2 = Label(root, text="my name is john elder")
# shoving it into the screen

myLabel.grid(row=0, column=0)
myLabe2.grid(row=1, column=0)

root.mainloop()