I want to know what is a simplest way to write method which generates me number from 1 to 50, and then depends of generated number returns me string like:
Abcdef if generated number is 6
Abcdefghi if generated number is 9.
I’m using python 3.2
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s a few approaches, the simplest:
Or you can have a go with
itertools: