Question: Write a Python program ( called q 2 . py ) that accepts an integer n ( 1 < = n < = 9 )

Write a Python program (called q2.py) that accepts an integer n (1<= n <=9) and compute the value of n + nn + nnn.
There are multiple ways to complete this problem. One basic method that we have covered so far is to rely on number systems.
nn = n *10+ n
nnn = n *100+ n *10+ n

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!