(Random character) Write a program that displays a random uppercase letter using the time.time() function.
Program Code:
import random
import time
# Get the current time in seconds since the epoch
currentTime = int(time.time())
# Set the seed for the random number generator
random.seed(currentTime)
# Generate a random ASCII value for an uppercase letter (65 to 90)
randomASCII = random.randint(65, 90)
# Convert the ASCII value to a character
randomCharacter = chr(randomASCII)
# Display the random uppercase letter
print("Random Uppercase Letter:", randomCharacter)
Executed Output 1:
Random Uppercase Letter: I
Executed Output 2:
Random Uppercase Letter: G