I'm new to python ,please tell me the way to write a program using python , to convert any decimal number into octal number(base 8) (using python 2.7)
casper1
0
Newbie Poster
Recommended Answers
Jump to PostDivide by 8 and reverse the remainders.
Don't steal other's thread, please but start new one of your own!
Jump to PostThe main thing is to be clear in your own mind about what you are doing. You are not "converting a decimal number". What you want to do is display a number in octal. This is done by formatting the number. The big hammer is built-in function
format
which uses …
All 5 Replies
TrustyTony
888
pyMod
Team Colleague
Featured Poster
griswolf
304
Veteran Poster
JeoSaurus
32
Posting Whiz in Training
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
casper1
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.