Deep into Ring

This is a fancy way to full-fill your list with even numbers. And of course you can fill it with whatever you want. but this is an automated way in order to fasten your way of development. you can find that it’s done in few lines.

There it’s

# Declaration of an empty list.
myList = [] 

# this list size, it also could be taken as input.
listSize = 10 

# function call by passing the list and maximum size.
generateEven(myList, listSize) 

# to view the list
see myList 

func generateEven inp_List,maxLen #function body.
        # For-loop starts from 0 index to maxLen with step 2 bec we need even numbers.
	for i=0 to maxLen step 2 
		#to add in inp_List the value of i.

and of course the output should be:


PS: and of course you can save your time by implementing function like above. That file could have your defined functions for automation. That will save your time and re-usability will be involved.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s