Advertisement
Yegor2305

Untitled

Apr 7th, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. class Employee():
  2.     def __init__(self, name, surname, salary):
  3.         self.name = name
  4.         self.surname = surname
  5.         self.salary = salary
  6.     def from_string(string):
  7.         name = string[ : string.find("-")]
  8.         help_str = string[string.find("-") + 1 : ]
  9.         surname = help_str[ : help_str.find("-")]
  10.         salary = help_str[help_str.find("-") + 1 : ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement