Python Program to Convert Binary to Gray Code

This is a Python program to convert binary to Gray code. Problem Description We are given a binary number. We have to find the associated Gray codeword. Problem Solution 1. The function binary_to_gray is defined. 2. It takes the binary number as a string as argument. 3. It returns its associated Gray codeword as a … Read more

advertisement

Python Program to Convert Gray to Binary Code

This is a Python program to convert Gray code to binary. Problem Description We are given a Gray codeword. We have to find the associated binary number. Problem Solution 1. The function gray_to_binary is defined. 2. It takes the Gray codeword string as argument. 3. It returns its associated binary number as a string. 4. … Read more

advertisement

Python Program to Generate Gray Codes using Recursion

This is a Python program to generate all gray codes using recursion Problem Description The number of bits n is given. The problem is to generate the n-bit Gray code. The Gray code is an ordering of the binary numbers such that two successive codewords differ in only one bit. Problem Solution 1. The function … Read more

advertisement

Python Program to Convert Celsius to Fahrenheit

Problem Description Write a Python program that takes the temperature in Celsius and converts it to Fahrenheit. What is Celsius? Celsius is a unit used to measure temperature on the Celsius scale. It is named after the Swedish astronomer Anders Celsius and is commonly represented by the symbol °C(degree Celsius). What is Celsius scale? The … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.