Question 51: Return an input string conditionally Implement the function below to receive a string of input from the use
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Question 51: Return an input string conditionally Implement the function below to receive a string of input from the use
Question 51: Return an input string conditionally Implement the function below to receive a string of input from the user. If the inputted string is less than or equal to 20 characters long, it should be returned from the function. Otherwise, return the string 'input too long'. print.py 1 - def get_a_short_string(): 2- if len() <= 20: 3 return 4. else: 5 print('input too long') Restore original file Save & Grade 7 attempts left Save only 7 points available for this attempt (following attempts are worth: 6, 5, 4, 3, 2, 1)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!