How to Check IF a Number is Harshad or Niven Number in Python |EP-31 Harshad/Niven Number in Python

Subscribers:
27,900
Published on ● Video Link: https://www.youtube.com/watch?v=vKzGaGvjOUk



Duration: 0:00
31 views
0


"""Harshad Numbers can be divided by the sum of its digits. They are also called
Niven Numbers. For instance, 18 is a Harshad Number as it can be divided by 9, the sum of
its digits (8+1=9)"""
Num = input("enter the number:")
print(num)
num = int(num)
digit_1 = num[0:1]
print(digit_1)
digit_2 = num[1:]
print(digit_2)
sum = int(digit_1)+int(digit_2)
print(sum)
if num%sum==0:
print("given number is harshad/niven number")
else:
print("not harshad/navin number")

#PythonProgramming #HarshadNumber #NivenNumber #PythonTutorial #CodingForBeginners #LearnPython #PythonNumbers #ProgrammingBasics #TechTonic #PythonCode #PythonExamples #HarshadNumbers #NivenNumbers #CodingTutorial #PythonCode #Programming #Coding #Tech #Education #Tutorial

Connect With Us:
—————————————
➡️ Website: https://www.cybrosys.com/
➡️ Email: info@cybrosys.com
➡️ Twitter:   / cybrosys  
➡️ LinkedIn:   / cybrosys  
➡️ Facebook:   / cybrosystechnologies  
➡️ Instagram:   / cybrosystech  
➡️ Pinterest:   / cybrosys  




Other Videos By Cybrosys Technologies


2024-08-30How to Merge Multiple Vendor Bills in Odoo 18 Purchase App | Merge Multiple Vendor Bills in Odoo 18
2024-08-28How to Configure Bank Reconciliation in Odoo 17 Accounting App | Bank Reconciliation in Odoo 17
2024-08-28How to Register Payment Against Draft Invoice in Odoo 18| Odoo 18 New Features| Odoo 18 Release Date
2024-08-28How to use Python Comparison Operators | EP-33 Python Comparison Operators | Precedence in Python
2024-08-27Odoo 18 New HTML Editor | HTML Editor in Odoo 18 | Odoo 18 New Features | Latest Feature in Odoo 18
2024-08-27How to Create an Event Template in Odoo 17 Event App | Event Templates in Odoo 17 Events | Odoo 17
2024-08-27Operators in Python | EP-32 Arithmetic Operators in Python | Python Tutorials for Beginners | Python
2024-08-26How to Configure Products in Odoo 17 Website App | Product Management in Odoo 17 Website App
2024-08-26Bill/PO Matching & Down Payments in Odoo 18 Purchase App | Odoo 18 Down Payments on Purchase Orders
2024-08-26How to Configure Authorized Signatory on Invoice in Odoo 18| Odoo 18 Authorized Signatory on Invoice
2024-08-25How to Check IF a Number is Harshad or Niven Number in Python |EP-31 Harshad/Niven Number in Python
2024-08-22How to Create & Automate Asset Model in Odoo 17 Accounting | Asset Model & Automation in Odoo 17
2024-08-22How to Configure Taxes in Company Currency in Odoo 18 Accounting | Odoo 18 New Features | Odoo 18
2024-08-22Inside Cybrosys | A Glimpse into Our World | Best IT Company in Calicut, Kochi | Best Odoo Company
2024-08-21How to Make Sure One2Many Records Are Deleted When the Parent Record Deleted in Odoo 17
2024-08-21Closing Entry by Product in Odoo 18 POS | Closing Entry by Product in Odoo 18 Point of Sale |Odoo 18
2024-08-21Revamped POS User Interface in Odoo 18 | Odoo 18 Revamped Point of Sale User Interface | Odoo 18 POS
2024-08-20How to Check if a Number is Even or Odd in Python| EP-30 Check Given Number is Even or Odd in Python
2024-08-20Odoo 18 Events PWA | Registration Desk Kiosk | Event Kiosk Mode in Odoo 18 | Odoo 18 New Features
2024-08-20How to Create Event Stages in Odoo 17 Events App | How to Manage Event Stages in Odoo 17 Events App
2024-08-19What is Boolean Data Type in Python | EP-29 Boolean Datatype in Python | Python Booleans| Data Types