Write a function called simulate_key_strike. It should take no arguments, and it should return a random one-character string that is equally likely to be any of the 26 lower-case English letters, 26 upper-case English letters, or any number between 0-9 (inclusive).
Answers
Answered by
0
Explanation:
sorry don't know the answer
Answered by
0
Given below is the program for the required function in python programming language.
Explanation:
- Python defines a set of functions that are used to generate or manipulate random numbers through the random module.
- 'choice()' is an inbuilt function offered by the random module in the Python programming language that returns a random item from a list, tuple, or string.
- Here we generate a string consisting of all the alphabets in upper case, all the alphabets in lower case and numerical values and use choice function to obtain a random character from it as required.
- PROGRAM:
- import random
- def simulate_key_strike:
- s="abcdeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR
- STUVWXYZ1234567890"
- c= random.choice(s)
- return s
Similar questions