Python Temel BilgilerKolay

Pozitif veya Negatif sayı

'Pozitif veya Negatif sayı' sorunu için ayrıntılı kılavuz ve Python uygulaması.

Sorun Bildirimi

Kolay

n tamsayısını alan ve n sıfırdan büyükse "Positive" dizesini, n sıfırdan küçükse "Negative" veya n tam olarak sıfırsa "Zero" dizesini döndüren check_sign(n) işlevini yazın.

Kısıtlamalar
  • -10^9 <= n <= 10^9

Örnekler

Example 1
Input
n = 5
Output
"Positive"
Explanation

5 is greater than 0, so we return "Positive".

Example 2
Input
n = -3
Output
"Negative"
Explanation

-3 is less than 0, so we return "Negative".

Example 3
Input
n = 0
Output
"Zero"
Explanation

0 is neither positive nor negative, so we return "Zero".

Need a Hint?
Kümeler veya yığınlar gibi Basics'e özgü veri yapılarını kullanmayı düşünün.
Edge Cases to Watch
  • Boş giriş yapıları
  • Tek eleman girişleri
  • Büyük sayısal sınırlar

Çözmeye Hazır mısınız?

Open the problem in PyRun's browser-based Python editor. Your code runs fully offline — no server required.

Editörde Aç
Found this breakdown helpful?

PyRun is built and maintained by an independent solo developer. If this helped your interview prep, consider buying a coffee!

Buy me a coffee

Önerilen Python Kaynakları

İlgili etkileşimli eğitimler, yardımcı sayfalar ve kod karşılaştırmalarıyla bilginizi genişletin.