Remember the game of FizzBuzz from the last time? Well, I thought of some changes in the game, and also with the help of loops as well. Firstly, you'll be asking for a random integer and then loop from 1 until that integer. Then, implement these conditions in the game:
Input
A line containing an integer.
15Output
Multiple lines containing a string or an integer.
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzzAs I've said before, there are three types of numbers: the positive, the zero, and the negative ones. Today, we shall pay attention only to the negative ones now. Make a loop that will accept random decimal/float numbers. When the user inputs 0, the loop will terminate and then output the sum of all negative numbers inputted in 3 decimal places.
Let's code this.
Input
Multiple lines containing a decimal .
2.4434
-1.3433
-2.444
6.432
0Output
A line containing a decimal with three decimal places.
-3.787I'm really fond of even numbers, you know? That's why I'll be letting you make another even number problem yet again. This time, you need to print from a range of two inputted numbers, n1 and n2 (inclusive), all the even numbers from n2 down to n1, in descending order.
How about that?
Input
A line containing two integers separated by a space.
3·10Output
Multiple lines containing an integer.
10
8
6
4The greatest common divisor, also known as GCD, is the greatest number that will, without a remainder, fully divide a pair of integers.
Now, I want you to make a program that will accept two integers and with the use of loops, print out their GCD. Make good use of conditional statements as well.
Off you go!
Input
A line containing two integers separated by a space.
6·9Output
A line containing an integer.
3Day name
For those of you who may not now, a factorial is a product of multiplying from 1 until the number. Now, you must make a program that will accept an integer and then print out its factorial using loops.
Are you up for this task?
Instructions:
Input
A line containing an integer.
5Output
A line containing an integer.
120translate the binary search and insertion algorithm into a subprogram BINARY(ARRAY,LB,UB,ITEM,LOC) which finds either the location LOC where ITEAM appears in ARRAY or the location LOC where ITEAM should be inserted into Array using python
What will the Linux command, du -h -d 1 | sort -hr, produce as output.
Given a 5-D python array with shape (24x4096x2016x24x8), and each element in the array is a 8-bit unsigned integer, calculate the approximate amount of RAM such array will take if you are using them in python.
BINARY(ARRAY,LB,UB,ITEM,LOC) which finds the location LOC where ITEM appears in ARRAY