Charm and beauty production with semi-leptonic decay into electrons in DIS and PHP at ZEUS ZEUS Collaboration Abstract The production of heavy quarks in ep interactions has been studied with the ZEUS detector at HERA in the photoproduction and DIS regimes using an integrated luminosity of 360 pb-1. The heavy flavour events were identified using electrons with a transverse momentum of at least pT(e)>0.9 GeV in the range eta(e)<1.5. The fractions of events containing the heavy quarks were extracted from a likelihood fit using variables sensitive to electron identification as well as to semileptonic decays. Total and differential cross sections for beauty, and in the case of photoproduction also for charm, were measured and compared with next-to-leading-order QCD calculations and Monte Carlo models. For squared four-momentum exchange of 10