I'm going to use a=random.uniform (0,10) to generate a random number.
You have to repeatedly generate different random numbers each time, and then re-enter random.uniform(0,10) each time
I only know how to give it to them ㅠ<
In the case of C language, I heard that there is a command that changes the value every time you type a
I'd appreciate it if you could tell me what Python is ㅠ<
python
You just have to write a repeat sentence. Learn Python lectures on repeat sentences at Programmers Python lectures.
import random
while True:
if input() == 'a':
a = random.uniform(0,10)
else:
break
In the example above, each time you enter a on the keyboard, you assign a new random number to the variable a, and if you do not enter a on the keyboard, the program will exit.
551 Who developed the "avformat-59.dll" that comes with FFmpeg?
551 Understanding How to Configure Google API Key
757 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
545 GDB gets version error when attempting to debug with the Presense SDK (IDE)
546 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.