Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ICS3U Python Programming Evaluation Question 3 File Name: ICS3UhexNibbles.py Write a function that converts any length binary number to its decimal equivalent. It must accept

ICS3U Python Programming Evaluation Question 3

File Name: ICS3UhexNibbles.py

Write a function that converts any length binary number to its decimal equivalent. It must accept a String value for the binary number and return the decimal equivalent

Use that function to write a program that accepts an entire string of binary nibbles entered from the keyboard and prints out the full hex equivalent. The nibbles in the input must be separated by spaces.

For Example:

  • An input of 0101 1101 produces an output of 5D
  • An input of 0000 1001 0001 1111 1100 produces an output of 091FC

Note: If you were planning on searching the internet on how to convert binary to decimal/hex numbers in python you might come across an interesting use of the int() function to accomplish this task. Or you might even find a built in function called hex(). You are not allowed to use those use cases in your solution. Impress me and do the conversion from scratch with a loop demonstrating what you know about lists/strings.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions