i have one question which i could not able to solve ,if anybody please help me to solve this question,it would be greate help from your side, thank you
iam using windows in my home python 2.7.13 and in workplace iam using ubuntu python version 2.7.12 i have a list of number 1 to 10 first print the number then prompt should ask the user please select your number if the user select number 6 then except number 6 all other number should display,but number 6 should not dispaly
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there! Sounds like you’re learning Python. There are a lot of great resources out there to help you get started. Dive Into Python is a favorite of mine and available for free online. In fact there are quite a few introductory Python tutorials right here on the DigitalOcean community site. We even compiled them into a free ebook:
Here’s a hint to point you in the right direction: You can prompt a user and capture their input using the builtin input function. For example:
>>> number = input("Choose a number between 1 and 10.\n")
Choose a number between 1 and 10.
2
>>> print(number)
2
After getting that input, you could use a “for loop” to iterate over your set of numbers, comparing them to the input. Then using a conditional statement, if the number doesn’t match, print it. If it does match, just move one to the next.
Hope that helps point you in the right direction!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.