Given a number N, write a program to print a triangular pattern of N lines with numbers as shown below.
N = 4
Part 1
The volume of a sphere is 4/3πr3, where π has the value of "pi" given in Section 2.1 of your textbook. Write a function called print_volume (r) that takes an argument for the radius of the sphere, and prints the volume of the sphere.
Call your print_volume function three times with different values for radius.
Include all of the following in your Learning Journal:
Part 2
Write your own function that illustrates a feature that you learned in this unit. The function must take at least one argument. The function should be your own creation, not copied from any other source. Do not copy a function from your textbook or the Internet.
Include all of the following in your Learning Journal:
Using IDLE development you must use script mode to develop your script . Your script must use meaningful variable names and have comments that describe what is happening in your script . Comments may describe the assignment of value to a variable , a computation and the assignment of the result to a variable , or the display of the result . Write a function in this file called nine_lines that uses the function three_lines to print a total of nine lines . Now add a function named clear_screen that uses a computation of functions nine_lines ,three_lines ,and new_lines to print a total of twenty- five lines . The last lines of your program should call first nine_lines and then the clear_screen function.
Given an integer N, write a program to print the hollow diamond pattern in 2*N rows and 2*N columns, similar to the pattern shown below
Multiples of 3
You are given
The first line of input is an integer
N. The next N lines each contain an integer as input.
You are given
The first line of input is an integer
N. The next N lines each contain an integer as input.
You are given N inputs. Write a program to print the first prime number in the given inputs.
The first line of input is an integer
N. The next N lines each contain an integer.
As programs get bigger and more complicated, they get more difficult to read.this is one reason why programmers should use comments in their code
You are given N inputs. Print the given inputs until you encounter a multiple of 5.