OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

how to have range in python act as a selection

  • Thread starter Thread starter Ubobque Sanders
  • Start date Start date
U

Ubobque Sanders

Guest
I am programming in python and I want to take the input of the user and determine a response based on the range that I receive an answer like if they respond with 50 I respond with 60 based on the range that is from 41-50. I have a written this as my range function but I don’t know how to print out something based on the response and connect it to the range.

This is the range function I am using:

list(range(0, 10, 1))

I've been reading on the web and I am still unsure how to connect it.

here is my code:

Code:
yardage = input("Please enter total yardage ")

print( yardage + "yards")

club = input(
    "Please enter the club that you used. If you don't know this, simply press space and we will fill it in for you. ")

if club == " ":
  print()
<p>I am programming in python and I want to take the input of the user and determine a response based on the range that I receive an answer like if they respond with 50 I respond with 60 based on the range that is from 41-50. I have a written this as my range function but I don’t know how to print out something based on the response and connect it to the range.</p>
<p>This is the range function I am using:</p>
<p>list(range(0, 10, 1))</p>
<p>I've been reading on the web and I am still unsure how to connect it.</p>
<p>here is my code:</p>
<pre class="lang-py prettyprint-override"><code>
yardage = input("Please enter total yardage ")

print( yardage + "yards")

club = input(
"Please enter the club that you used. If you don't know this, simply press space and we will fill it in for you. ")

if club == " ":
print()

</code></pre>
 

Latest posts

G
Replies
0
Views
1
Gamal Othman
G
Top