One of the coarsest topological invariants is the Euler characteristic of cohomology with compact support. For a complex algebraic variety $X$ considered as a set of $\mathbb{C}$-rational points with the classical / Euclidean / analytic topology, for a Zariski closed subset $Z\subseteq X$ with its induced topology, and for the open complement $X\setminus Z$ with its induced topology, there is a long exact sequence of compactly supported cohomology, $$\dots \to H^r_c(X\setminus Z;\mathbb{Z}) \to H^r_c(X;\mathbb{Z}) \to H^r_c(Z;\mathbb{Z}) \xrightarrow{\delta} H^{r+1}_c(X\setminus Z;\mathbb{Z})\to \dots $$ This gives rise to an equality of compactly supported Euler characteristics, $$\chi_c(X) = \chi_c(X\setminus Z) + \chi_c(Z).$$ Thus, for a linearly nondegenerate, irreducible, Zariski closed subset $X$ of $\mathbb{P}^n$ that is smooth, if for every hyperplane section $H$ the open complement $X\setminus H$ has equal Betti numbers, then also the Euler characteristic $\chi_c(H)$ is independent of the choice of hyperplane section. On the other hand, for a field $k$ of <b>characteristic zero</b>, such as $k=\mathbb{C}$, for an integral closed subscheme $X$ of $\mathbb{P}^n_k$ that is smooth, a general pencil $(H_t)_{t\in \Pi}$ of hyperplane sections $H_t$ will be a <b>Lefschetz pencil</b>. There are many references for this; one reference is Corollary 2.10, p. 46 of the following. MR2449178 (2009j:32015) <br> Voisin, Claire <br> Hodge theory and complex algebraic geometry. II. <br> Translated from the French by Leila Schneps. Reprint of the 2003 English edition. <br> Cambridge Studies in Advanced Mathematics, 77. <br> Cambridge University Press, Cambridge, 2007. x+351 pp. In positive characteristic, this can fail, although it is often still true. The standard reference is the second volume of SGA 7. In characteristic $0$, there will be only finitely many elements $t$ of the pencil, say $t\in\{t_1,\dots,t_\delta\}$, such that $H_t$ is singular, and each singular member $H_t$ will have a single ordinary double point. The finite set $\{t_1,\dots,t_\delta\}$ is the <b>discriminant locus</b>. For each such $t$, the Betti numbers of $H_t$ and of the nearby fibers $H_s$ will differ in precisely one degree, coming from a vanishing cycle, so that the difference of Betti numbers is $\pm 1$ (depending on the parity of the cohomological degree of the vanishing cycle). Thus, $\chi_c(H_t)-\chi_c(H_s)$ equals $+1$ or $-1$ for every $t$ in the discriminant locus. The precise cardinality of the discriminant locus is computed in my answer to a previous MathOverflow question: https://mathoverflow.net/questions/165672/bounding-the-number-of-critical-points-in-a-lefschetz-pencil <br>