Jan-12-2019, 08:03 PM
(This post was last modified: Jan-12-2019, 08:11 PM by ichabod801.)
Hey i need to write a program to school and im new to python so im trying different things.
I need to choose 50 random numbers from interval f.e. from 100 random numbers and do number**0.5 and i need it to output the whole numbers that are int after finishing = 25**0.5=5
i have this but honestly its bad af or idk
I need to choose 50 random numbers from interval f.e. from 100 random numbers and do number**0.5 and i need it to output the whole numbers that are int after finishing = 25**0.5=5
i have this but honestly its bad af or idk
import random def main(): for i in range(50): list=random.randint(1,100) a =[list] for i in a: if i**(0.5)==0: print(i)I dont know what to do because we have like teacher that doesnt know it either so i dont know