CS104 Homework 01 Solved

29.99 $

Description

5/5 - (1 vote)

1.  Write a Python program which accepts the diameter of a circle from the user as command line argument, compute the area of the circle and print it to the screen.
2.  Imagine we have a sequence of numbers as follows:
3, , , , ,…
Write a program that prints nth number in this sequence.
For example if n is set as 2, it will print 2.5, if n is set as 4 it will print 1.125 etc. Please demonstrate the printing of the program for n=5, n=8, n=11.
3. (25 pts) Write a program that tells how many digits there are in a number? For example it will print “2” for 89, “5” for 43201 etc.
4. Write a program that prints the following image.

  • Homework-1-5z9ftr.zip