Prepare a python program

Assignment Help Python Programming
Reference no: EM135189

You will define an operation on positive integers called twiddle which consists of summing the squares of the digits of the input number (when represented as a decimal). Therefore, twiddle(23) = 22 + 32 = 13. A number's twiddle distance is the number of times one must repeatedly apply this operation to get to 1 (one). The twiddle distance of one is zero, and the twiddle distance of 23 is 3 because twiddle(23) = 13, twiddle(13) = 10, and twiddle(10) = 1. Some numbers never reach one, though, because they get stuck in a loop and therefore have infinite twiddle distance. you will call such numbers stuck numbers. Your assignment is to prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments (defining an inclusive range).

Reference no: EM135189

Questions Cloud

Expected convenience from each restaurant : Calculate whole expected convenience from each restaurant option and also compare?
Discuss new security features in windows server : Which of the system changeover methods is the most expensive? Why? Which of the system changeover methods is the most risky? Why?
Time domain design and analysis : To design a "custom" controller to reduce the vibrations of the seat and a PID controller to reduce the vibration of the seat
Depth analysis of a global cold chain : The logistics of a global cold chain getting fresh vegetables from farms in Thailand to supermarkets in Europe
Prepare a python program : Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.
Prepare an original code of ethics for your company : Your task is to prepare an original Code of Ethics for your company or organization. You may also select to create a Code of Ethics for a fictitious organization or company if you prefer not to use your employer
Opengl assignment using c++ : This is an OpenGL assignment using C++. Work on a particle and mesh visualization tool. Data: Consider a point cloud as input data. Every point is described by a position p = (x, y, z) and a data value d = (d0,d1,d2).
Find out the y component of the magnetic field : A 2.0-C charge moves with a velocity of (2.0i + 4.0j + 6.0k) m/s and experiences a magnetic force of (4.0i - 20j + 12k) N. The x component of the magnetic field is equal to zero. Find out the y component of the magnetic field.
Why do celebrity icons receive such widespread attention : Why do celebrity icons receive such widespread attention and adulation

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd