0
Can any one help me to get rid of this problem... ?
Python program to print cube numbers upto a given number
13 Antworten
+ 2
Can you show your attempt?
It's simple
Take a input number take a variable for the cube and mark the range till what you want the cube
+ 2
n=int(input())
for i in range(1,n):
print(i*i*i)
0
Can you tell me the range
0
Suppose if we give the number as 10 I want the cube numbers upto 10 only i.e 1,8 that's it. I don't want beyond that. For that what is the for loop range
0
Thank you Bhavya Sarraf
But for input 100 it prints upto 27 only
0
Thank you Bhavya Sarraf
0
n= int(input('Enter a number'))
cube = [x**3 for x in range(1,n)]
print (cube)
0
Thank you Ravi Teja
0
Welcome Nandini B N✌️