+ 1
Bacteria
A cell has 500 bacteria, for every hour it double in number, i.e 500x2=1000..... 1000x2=2000. Write a python program to output and calculate the number of bacteria there will be in 24 hours. Formula is 500*2^n Where is number for every hour
10 Respostas
+ 3
Maybe iâd post the question again. I have no idea on how to go with the question itself
+ 3
# python
print(500*2**int(input()))
+ 2
n is the number of hours.
So for 24 hours, n = 24
formula is given
Now Where's your attempt..?
+ 2
The Last Cherry Blossom
The program is python sir
+ 1
Can you pls help with it. My knowlege for mathematics is not that lit
+ 1
import java.util.*;
public class Program
{
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
System.out.println(500*Math.pow(2,n));
}
}
// everything was given to you, the only thing that was needed to be done was to convert maths formula into codes
# python
print(500*2**int(input()))
+ 1
ââ
Barryđ§
Can you pls elaborate
+ 1
#python
print (500*2**24)
0
ââ
Barryđ§ your code is not working. Check my comment on the matter. It keeps generating an error at line 7 sorry đ€đ€