Skip to content
Sign UpLog In
Profile icon

Kyle d

@Kyled2
Repls
Community
Kyled2
Kyled2
shared a Post
1 year ago
4.9.6 Random Color Square (Python)
Hey there, I'm new to coding and am struggling quite a lot. The program wants a (480, 400) rectangle that is randomly colored. Could you help me out?
SamDev7
SamDev7
Python's random libary should help with that. Here's an example. import random fruits = ['apple','banana','orange','grape'] lunch = random.choice(fruits) print("I will get " + lunch + " for lunch.") Everytime you run the code, it will pick a random thing from the list and print it.1 year ago