-1
#python
    joe=(22,"medical","second class ")
    layla=(23,"medical","third class")

    name_of_employee=input("write the name of employee that you need his information ")

print("")

I need a method when the user input the name as joe the python print his information

PM 77-1
  • 12,933
  • 21
  • 68
  • 111
  • 1
    You *don't* need to do that and you *shouldn't*. Instead, use a *container* like a `dict` that maps a `str` to another object, and use that `dict` with the `str` you receive from user input – juanpa.arrivillaga Aug 02 '22 at 17:17

1 Answers1

0

Dictionary may help you:

employees_info = {"joe": (22,"medical","second class "),
                  "layla": (23,"medical","third class")}

name_of_employee=input("write the name of employee that you need his information ")

print(employees_info[name_of_employee])
Soheil
  • 473
  • 9
  • 23