TITLE: does a line bundle always have a degree
QUESTION [19 upvotes]: For curves there is a very simple notion of degree of a line bundle or equivalently of a Weil or Cartier divisor.  Even in any projective space $\mathbb P(V)$ divisors are cut out by hypersurfaces which are homogeneous polynomials of a certain degree.  
Is there a more general notion of degree that applies to schemes with less structure?
Also, say you have a nice enough scheme $X$ so line bundles correspond to Cartier divisors under linear equivalence.  In whatever the most general setting is so that the degree of a line bundle makes sense, is there an example of a line bundle $L \ne O_X$ that is degree 0 and has $h^0(L$) = 1?

REPLY [3 votes]: I have a silly answer to your second question.  Take a disjoint union of an elliptic curve with any other curve, and set L to be a nontrivial degree 0 bundle on the elliptic curve and trivial on the other curve.