My First Blog Post

Be yourself; Everyone else is already taken.

— Oscar Wilde.

This is the first post on my new blog. I’m just getting this new blog going, so stay tuned for more. Subscribe below to get notified when I post new updates.

Travel.

Travel dates back to antiquity where wealthy Greeks and Romans would travel for leisure to their summer homes and villas in cities such as Pompeii and Baiae.[7] While early travel tended to be slower, more dangerous, and more dominated by trade and migration, cultural and technological advances over many years have tended to mean that travel has become easier and more accessible.[8] Mankind has come a long way in transportation since Christopher Columbus sailed to the new world from Spain in 1492, an expedition which took over 10 weeks to arrive at the final destination; to the 21st century where aircraft allow travel from Spain to the United States overnight.

Travel in the Middle Ages offered hardships and challenges, however, it was important to the economy and to society. The wholesale sector depended (for example) on merchants dealing with/through caravans or sea-voyagers, end-user retailing often demanded the services of many itinerant peddlers wandering from village to hamlet, gyrovagues (Wandering Monks) and wandering friars brought theology and pastoral support to neglected areas, travelling minstrels practiced the never-ending tour, and armies ranged far and wide in various crusades and in sundry other wars.[7] Pilgrimages were common in both the European and Islamic world and involved streams of travellers both locally (Canterbury Tales-style) and internationally.[9]

In the late 16th century it became fashionable for young European aristocrats and wealthy upper class men to travel to significant European cities as part of their education in the arts and literature. This was known as the Grand Tour, it included cities such as London, Paris, Venice, Florence and Rome. However, The French revolution brought with it the end of the Grand Tour.[7]

Travel by water often provided more comfort and speed than land-travel, at least until the advent of a network of railways in the 19th century. Travel for the purpose of tourism is reported to have started around this time when people began to travel for fun as travel was no longer a hard and challenging task. This was capitalised on by people like Thomas Cook selling tourism packages where trains and hotels were booked together.[10] Airships and airplanes took over much of the role of long-distance surface travel in the 20th century, notably after the second World War where there was a surplus of both aircraft and pilots.[7]

Safety

Authorities emphasize the importance of taking precautions to ensure travel safety.[12] When traveling abroad, the odds favor a safe and incident-free trip, however, travelers can be subject to difficulties, crime and violence.[13] Some safety considerations include being aware of one’s surroundings,[12] avoiding being the target of a crime,[12] leaving copies of one’s passport and itinerary information with trusted people,[12] obtaining medical insurance valid in the country being visited[12] and registering with one’s national embassy when arriving in a foreign country.[12] Many countries do not recognize drivers’ licenses from other countries; however most countries accept international driving permits.[14] Automobile insurance policies issued in one’s own country are often invalid in foreign countries, and it is often a requirement to obtain temporary auto insurance valid in the country being visited.[14] It is also advisable to become oriented with the driving-rules and -regulations of destination countries.[14] Wearing a seat belt is highly advisable for safety reasons; many countries have penalties for violating seatbelt laws.[14]

There are three main statistics which may be used to compare the safety of various forms of travel (based on a DETR survey in October 2000):[15]

THE EVOLUTION OF TECHNOLOGY: PAST, PRESENT AND FUTURE

Technology runs our lives these days. Smartphones, tablets and computers – we really can’t seem to function without them. In a very short amount of time, technology has exploded in the market and now, many people cannot imagine a life without it.

To understand how we left the dark ages (which really wasn’t all that long ago) to where we are today, it is important to understand how technology evolves and why it matters.

PURPOSE DRIVES TECHNOLOGY FORWARD

All technologies are born out of purpose. For example, search engines were created to sort through the massive amounts of data online. With each new upgrade technology compounds existing technologies to create something better than what was previously used before. And on and on it goes.

With the lightning speed of technological evolution, it is no wonder many people have struggled to keep up. To be fair, the scope of technology’s expanse is so great, wrapping everything up into a single blog post is practically impossible.

Here is just a brief glimpse into how rapidly the Internet and technology as a whole have evolved in recent years.

THE PAST: WORLD, MEET THE INTERNET

Looking back to the 1990’s, the Internet was a new commodity many, but not all, households and businesses began to gain access. For people living during that time, the sound of the painfully slow dial up signal connecting to the Internet is a not-so-fond memory (EEEE-AAAAAHH!!!!).

Thankfully, as more people found value in the Internet, technology took off to eliminate having to use a phone line to go online and instead delivered faster connections to the World Wide Web.

blog-laptop.jpg

WEBSITES AND BLOGGING ARE BORN

Websites advanced along with the internet. Suddenly, everyone had a Geocities or Tripod website dedicated to themselves. Just in infancy, websites were basic in both function and design. This is also the time when the blogging craze started to set in on the consumer level with the introduction of “weblogs” (later condensed to “blogs”). Remember Xanga? If only we knew then what we know now.

FLOPPY DISCS AKA THE REAL-LIFE SAVE-BUTTON ICON

A few years later, sharing information gradually started to become easier. Instead of handing over a floppy disc or CD-ROM, people began emailing documents or storing large files on USB sticks or flash drives.

As new technologies started to pop-up, each technology would compound and build to form a better, faster and stronger piece of technology. With this speedy development, the Internet changed the way people live, work and operate today.

THE PRESENT: SNAPS, CHATS AND DOUBLE TAPS

Fast-forward a short decade later (side note: remember VHS tapes!? The OG fast-forward? OK, moving on…).

Since the days of dial-up, access to the Internet is available almost everywhere. It is rare these days for consumers to go into a coffee shop, library or any place of business and not be able to access a Wi-Fi signal. If there isn’t a Wi-Fi signal in close range, most people still have access to the Internet via their cellular data connection on their smartphones and personal hotspots, no problem.

THERE’S AN APP FOR THAT

With this anywhere/anytime access to the Internet, businesses created web applications to answer common needs of consumers. These applications can do everything from tracking food portions to sending massive amounts of information in a click of a button.

social-media-phone.jpg

THE EVOLUTION AND REVOLUTION OF COMMUNICATION

How we communicate continued to evolve as well. Remember face-to-face conversations? Hand-written letters? Waiting by the phone – the kind with the cord? Technology perpetually reshapes our communication. Perhaps the most noticeable difference in the Internet today is the ability to be personable in such an impersonal setting. Constant connection seems to be the name of the game. And along with connection, we see instant availability. Bluetooth connections, talk-to-text, every form of messaging apps – while you’re driving, in meetings, at home. Connection. Everywhere.

MYSPACE, YOURSPACE, BOOKFACE: THE SOCIAL MEDIA AWAKENING

We’ve watched texting evolve from sending text-only messages (literally texting) to the addition of imagery, thanks to the viral spread of gifs, memes, emojies and bitmojies. In fact, with the spike in video-sharing, actual text is shrinking (meet SnapChat, Instagram Stories, Facebook Stories, Periscope, Vine, etc. and shorthand abbreviations). SMH.

Social networks continue to change the way people engage with one another. Ironically, the constant connection and way people interact with one another seems to morph to a more superficial setting online. Although superficial at times, this form of communication helps people stay closer to each other when they would have otherwise lost contact.

FACE TO FACE (VIRTUALLY, SPEAKING)

Face-to-face conversations via technology are resurfacing, though, and even strengthening, thanks to higher-quality video and streaming capabilities (enter: Skype, Google Hangouts, Zoom, FaceTime, live streaming, etc.). With more people engaging in web/video conferencing online, geographic barriers that once hindered communication were torn down. Instead, companies can engage with consumers in a more human manner, people can talk to people face-to-face without the need for costly travel and reaching out to people all over the world is faster and easier.

CUTTING THE CORD: THE ERA OF VIDEO STREAMING

Remember when Netflix was a primarily a DVD delivery company, bringing your favorite movie via mail? Back when binge-watching wasn’t a thing?

Today, people are cutting the cord when it comes to cable, opting for digital streaming and video services like Netflix, YouTube and Hulu. Big brands are trying to keep up and compete, doing their best to one-up each other with original content, availability and delivery channels (e.g. Apple TV, Amazon Fire TV, Google TV, etc.). User-generated content is a force to acknowledge as well. Thanks to streaming options like Facebook Live, Instagram Live and Periscope, individuals and business are able to broadcast their own videos and content.

In a nutshell, videos are popping up everywhere and trending big time. And they thought talking pictures would never last…

TODAY’S TECH FORECAST: ICLOUDY DAYS AHEAD

More people and companies are using cloud-based services for their business and store everything online instead of on a single device. This change will continue to have an enormous impact on the way business is done, transforming our once-traditional office environments and how people interact with companies on a regular basis. Flash drives are almost extinct with the prevalence of cloud storage, like iCloud, Google Drive, Dropbox and FTP sites.

With so many new technologies permeating the way people access information and access each other, the forward momentum looks promising for future technological developments.

THE FUTURE: EMERGING TRENDS ON THE HORIZON

As more existing technologies are stacked onto each other and developed into something greater, consumers and businesses alike can expect to see more opportunity with future technology. Technology will be faster, have the ability to accomplish more and everything will become more streamlined to make getting work done, easier.

While we don’t have the ability to predict the future, we can offer speculations on technology’s evolution. We are constantly seeing emerging media and new trends in technology to follow. Here are a few trends to watch for in the coming years.

SMART IS THE NEW SEXY

And by “smart” we mean the continued evolution of smart devices and rise of artificial intelligence (AI) technology.

Smart devices will continue to evolve to work better together. These machines will share data automatically limiting the need for human involvement. Of course, it’s not just smartphones, watches, TVs or tablets anymore.

THE INTERNET OF THINGS

You’ll hear more and more about the “Internet of Things” (IoT) now and in the future. The deeper we dive into technology, the more it seems we try to blend the physical and virtual worlds together. Smart speakers, smart homes and even smart cars are the tech wave to ride in the future, but it’s just the beginning.

Think of the Internet of Things as a network of physical devices – like handheld gadgets, vehicles, home appliances or any kind of electronic item with embedded software or technology – connected together and able to exchange data.

Gartner, an analyst firm, speculates there will be more than 26 billion connected devices by 2020. Imagine a future where your car warns you of heavy traffic or your alarm clock notifies you about your coffee brewing itself in the kitchen. Imagine living in a smart home in a smart city.

In other words, the future happening is now. Or at least, it’ll be here sooner than you may think.

WHY BOTHER KEEPING UP WITH TECHNOLOGY?

It’s a fair question. Technology is constantly changing and it sometimes feels like way too much effort to keep up with a moving target. Just remember – keeping up with technology adds value to your business.

Staying up-to-date helps ensure you don’t miss opportunities, become irrelevant or fall behind your competitors. Remember Kodak? They taught us all an invaluable lesson: don’t be afraid to embrace change.

Here are a few ways to keep up and stay informed:

  • Follow industry blogs (like ours!)
  • Listen to industry leaders
  • Follow topics on social media
  • Join groups (online and in-person)
  • Listen to podcasts
  • Engage in tech forums
  • Subscribe to relevant eNewsletters
  • Set up Google alerts

THE FINAL (FANTASY) FRONTIER

Space may not be the final frontier as we thought. Technology is a frontier on its own, continuing to evolve, grow and reshape our world. As we continue to explore and expand technology, the more life will change, creating new habits and forming new ways of working together.

While the future is unknown, we believe in leveraging technology to create personalized approaches and solutions.

Hope you liked it.

Thank you.

Evolution of our earth.

The history of Earth concerns the development of planet Earth from its formation to the present day. Nearly all branches of natural science have contributed to understanding of the main events of Earth’s past, characterized by constant geological change and biological evolution.

The geological time scale (GTS), as defined by international convention,[3] depicts the large spans of time from the beginning of the Earth to the present, and its divisions chronicle some definitive events of Earth history. (In the graphic: Ga means “billion years ago”; Ma, “million years ago”.) Earth formed around 4.54 billion years ago, approximately one-third the age of the universe, by accretion from the solar nebula.[4][5][6] Volcanic outgassing probably created the primordial atmosphere and then the ocean, but the early atmosphere contained almost no oxygen. Much of the Earth was molten because of frequent collisions with other bodies which led to extreme volcanism. While the Earth was in its earliest stage (Early Earth), a giant impact collision with a planet-sized body named Theia is thought to have formed the Moon. Over time, the Earth cooled, causing the formation of a solid crust, and allowing liquid water on the surface.

The Hadean eon represents the time before a reliable (fossil) record of life; it began with the formation of the planet and ended 4.0 billion years ago. The following Archean and Proterozoic eons produced the beginnings of life on Earth and its earliest evolution. The succeeding eon is the Phanerozoic, divided into three eras: the Palaeozoic, an era of arthropods, fishes, and the first life on land; the Mesozoic, which spanned the rise, reign, and climactic extinction of the non-avian dinosaurs; and the Cenozoic, which saw the rise of mammals. Recognizable humans emerged at most 2 million years ago, a vanishingly small period on the geological scale.

The earliest undisputed evidence of life on Earth dates at least from 3.5 billion years ago,[7][8][9] during the Eoarchean Era, after a geological crust started to solidify following the earlier molten Hadean Eon. There are microbial mat fossils such as stromatolites found in 3.48 billion-year-old sandstone discovered in Western Australia.[10][11][12] Other early physical evidence of a biogenic substance is graphite in 3.7 billion-year-old metasedimentary rocks discovered in southwestern Greenland[13] as well as “remains of biotic life” found in 4.1 billion-year-old rocks in Western Australia.[14][15] According to one of the researchers, “If life arose relatively quickly on Earth … then it could be common in the universe.”[14]

Photosynthetic organisms appeared between 3.2 and 2.4 billion years ago and began enriching the atmosphere with oxygen. Life remained mostly small and microscopic until about 580 million years ago, when complex multicellular life arose, developed over time, and culminated in the Cambrian Explosion about 541 million years ago. This sudden diversification of life forms produced most of the major phyla known today, and divided the Proterozoic Eon from the Cambrian Period of the Paleozoic Era. It is estimated that 99 percent of all species that ever lived on Earth, over five billion,[16] have gone extinct.[17][18] Estimates on the number of Earth’s current species range from 10 million to 14 million,[19] of which about 1.2 million are documented, but over 86 percent have not been described.[20] However, it was recently claimed that 1 trillion species currently live on Earth, with only one-thousandth of one percent described.[21]

The Earth’s crust has constantly changed since its formation, as has life since its first appearance. Species continue to evolve, taking on new forms, splitting into daughter species, or going extinct in the face of ever-changing physical environments. The process of plate tectonics continues to shape the Earth’s continents and oceans and the life they harbor. Human activity is now a dominant force affecting global change, harming the biosphere, the Earth’s surface, hydrosphere, and atmosphere with the loss of wild lands, over-exploitation of the oceans, production of greenhouse gases, degradation of the ozone layer, and general degradation of soil, air, and water quality.

Eons

In geochronology, time is generally measured in mya (million years ago), each unit representing the period of approximately 1,000,000 years in the past. The history of Earth is divided into four great eons, starting 4,540 mya with the formation of the planet. Each eon saw the most significant changes in Earth’s composition, climate and life. Each eon is subsequently divided into eras, which in turn are divided into periods.

Creating your own website in only 4 easy steps

Creating a website

Most customers will expect to be able to find your business on the internet. Whether you are selling your products online, or simply want to provide some information about your business and your contact details, having a website is almost essential.

It’s a good idea to think about what you hope to achieve with your website before you start creating one. Researching your competitors’ websites can help you get a clear idea of what may work best for you.

To create a website, you need to follow 4 basic steps.

1. Register your domain name

Your domain name should reflect your products or services so that your customers can easily find your business through a search engine. Your customers may also expect your domain name to be similar to your business name.

Your domain name will also be used for your email address. While you can use a free email address such as hotmail, sending emails from a business address looks more professional.

To register your domain name, you will need to find an accredited registrar and pay a fee. Accredited registrars are organisations who are authorised by auDA, the Australian domain name administrator, to provide services to people who want to register a new domain name, renew their existing domain name, or make changes to their domain name record.

2. Find a web hosting company

You will need to find a web hosting company to get your domain name on the internet. Most of the major internet service providers offer web hosting services. They can also provide you with multiple email addresses.

Monthly fees for web hosting vary depending on how large your website is and how many visits you get.

3. Prepare your content

Think about what you want your customers to be able to do via your website. This will help you work out what sections or pages you want to include. Consider what information or transactions your customers will want and make sure the site is structured to make it easy for them to find and do the things they need.

Just as you might hire a professional to design your site, you might also want to consider hiring a professional to write and structure your content.

A website that is well designed and easy for customers to use will help your business stand out. Having relevant and appropriate content and images will help customers understand your products and services and will make them feel comfortable with buying from your business.

4. Build your website

You can build your own website or have a professional web developer build it for you. Websites need to be kept up to date, so make sure you plan for ongoing maintenance.

You can use a website publishing package to build your own website. These are similar to word processors, but also have inbuilt features to convert your text and images to web content and send it to your website.

Having someone else build a website for you is a good idea if you’re new to online business. A professional web developer can build your site quickly and provide guidance on successful web design. Hiring a professional can be particularly useful if you are looking at having an online shop or offering other services through your website.

You will need to design your website so it can be easily used on smartphones and other mobile devices. Optimising your website for mobile use means that the growing number of people using phones and tablets to access the internet can use your site while they are out and about.

Useful tips for creating a website

  • Think about what your customers want to know, not just what you want to tell them.
  • Use professionals to help you. An unprofessional website can potentially put customers off.
  • Update your website regularly, especially if you include information about your prices.
  • Make sure your contact details are correct and easy for your customers to find.
  • Promote your website in your marketing material and include it on your business cards.
  • Find out how you can make your website easy for search engines, such as Google, to find. This is called search engine optimisation (SEO). A web developer can help you with SEO for your website.

PYTHON tips and tricks every programmer need to know about.

15 Essential Python Tips And Tricks For Programmers

Tips#1. In-Place Swapping Of Two Numbers.

Python provides an intuitive way to do assignments and swapping in one line. Please refer to the below example.

x, y = 10, 20
print(x, y)
 
x, y = y, x
print(x, y)
 
#1 (10, 20)
#2 (20, 10)

The assignment on the right seeds a new tuple. While the left one instantly unpacks that (unreferenced) tuple to the names <a> and <b>.

Once the assignment is through, the new tuple gets unreferenced and flagged for garbage collection. The swapping of variables also occurs at eventually.

TOC

Tips#2. Chaining Of Comparison Operators.

Aggregation of comparison operators is another trick that can come handy at times.

n = 10
result = 1 < n < 20
print(result)

# True

result = 1 > n <= 9
print(result)

# False

TOC

Tips#3. Use Of Ternary Operator For Conditional Assignment.

Ternary operators are a shortcut for an if-else statement and also known as conditional operators.

[on_true] if [expression] else [on_false]

Here are a few examples which you can use to make your code compact and concise.

The below statement is doing the same what it is meant to i.e. “assign 10 to x if y is 9, otherwise assign 20 to x“. We can though extend the chaining of operators if required.

x = 10 if (y == 9) else 20

Likewise, we can do the same for class objects.

x = (classA if y == 1 else classB)(param1, param2)

In the above example, classA and classB are two classes and one of the class constructors would get called.

Below is one more example with a no. of conditions joining to evaluate the smallest number.

def small(a, b, c):
	return a if a <= b and a <= c else (b if b <= a and b <= c else c)
	
print(small(1, 0, 1))
print(small(1, 2, 2))
print(small(2, 2, 3))
print(small(5, 4, 3))

#Output
#0 #1 #2 #3

We can even use a ternary operator with the list comprehension.

[m**2 if m > 10 else m**4 for m in range(50)]

#=> [0, 1, 16, 81, 256, 625, 1296, 2401, 4096, 6561, 10000, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521, 1600, 1681, 1764, 1849, 1936, 2025, 2116, 2209, 2304, 2401]

TOC

Tips#4. Work With Multi-Line Strings.

The basic approach is to use backslashes which derive itself from C language.

multiStr = "select * from multi_row \
where row_id < 5"
print(multiStr)

# select * from multi_row where row_id < 5

One more trick is to use the triple-quotes.

multiStr = """select * from multi_row 
where row_id < 5"""
print(multiStr)

#select * from multi_row 
#where row_id < 5

The common issue with the above methods is the lack of proper indentation. If we try to indent, it’ll insert whitespaces in the string.

So the final solution is to split the string into multi lines and enclose the entire string in parenthesis.

multiStr= ("select * from multi_row "
"where row_id < 5 "
"order by age") 
print(multiStr)

#select * from multi_row where row_id < 5 order by age

TOC

Tips#5. Storing Elements Of A List Into New Variables.

We can use a list to initialize a no. of variables. While unpacking the list, the count of variables shouldn’t exceed the no. of elements in the list.

testList = [1,2,3]
x, y, z = testList

print(x, y, z)

#-> 1 2 3

TOC

Tips#6. Print The File Path Of Imported Modules.

If you want to know the absolute location of modules imported in your code, then use the below trick.

import threading 
import socket

print(threading)
print(socket)

#1- <module 'threading' from '/usr/lib/python2.7/threading.py'>
#2- <module 'socket' from '/usr/lib/python2.7/socket.py'>

TOC

Tips#7. Use The Interactive “_” Operator.

It’s a useful feature which not many of us know.

In the Python console, whenever we test an expression or call a function, the result dispatches to a temporary name, _ (an underscore).

>>> 2 + 1
3
>>> _
3
>>> print _
3

The “_” references to the output of the last executed expression.

TOC

Tips#8. Dictionary/Set Comprehensions.

Like we use list comprehensions, we can also use dictionary/set comprehensions. They are simple to use and just as effective. Here is an example.

testDict = {i: i * i for i in xrange(10)} 
testSet = {i * 2 for i in xrange(10)}

print(testSet)
print(testDict)

#set([0, 2, 4, 6, 8, 10, 12, 14, 16, 18])
#{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81}

Note- There is only a difference of <:> in the two statements. Also, to run the above code in Python3, replace <xrange> with <range>.

TOC

Tips#9. Debugging Scripts.

We can set breakpoints in our Python script with the help of the <pdb> module. Please follow the below example.

import pdb
pdb.set_trace()

We can specify <pdb.set_trace()> anywhere in the script and set a breakpoint there. It’s extremely convenient.

TOC

Tips#10. Setup File Sharing.

Python allows running an HTTP server which you can use to share files from the server root directory. Below are the commands to start the server.

# Python 2

python -m SimpleHTTPServer

# Python 3

python3 -m http.server

Above commands would start a server on the default port i.e. 8000. You can also use a custom port by passing it as the last argument to the above commands.

TOC

Tips#11. Inspect An Object In Python.

We can inspect objects in Python by calling the dir() method. Here is a simple example.

test = [1, 3, 5, 7]
print( dir(test) )
['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getslice__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']

TOC

Tips#12. Simplify If Statement.

To verify multiple values, we can do in the following manner.

if m in [1,3,5,7]:

instead of:

if m==1 or m==3 or m==5 or m==7:

Alternatively, we can use ‘{1,3,5,7}’ instead of ‘[1,3,5,7]’ for ‘in’ operator because ‘set’ can access each element by O(1).

TOC

Tips#13. Detect Python Version At Runtime.

Sometimes we may not want to execute our program if the Python engine currently running is less than the supported version. To achieve this, you can use the below coding snippet. It also prints the currently used Python version in a readable format.

import sys

#Detect the Python version currently in use.
if not hasattr(sys, "hexversion") or sys.hexversion != 50660080:
    print("Sorry, you aren't running on Python 3.5\n")
    print("Please upgrade to 3.5.\n")
    sys.exit(1)
    
#Print Python version in a readable format.
print("Current Python version: ", sys.version)

Alternatively, you can usesys.version_info >= (3, 5) to replacesys.hexversion!= 50660080 in the above code. It was a suggestion from one of the informed reader.

Output when running on Python 2.7.

Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.8.2] on linux
   
Sorry, you aren't running on Python 3.5

Please upgrade to 3.5.

Output when running on Python 3.5.

Python 3.5.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
   
Current Python version:  3.5.2 (default, Aug 22 2016, 21:11:05) 
[GCC 5.3.0]

TOC

Tips#14. Combining Multiple Strings.

If you want to concatenate all the tokens available in a list, then see the below example.

>>> test = ['I', 'Like', 'Python', 'automation']

Now, let’s create a single string from the elements in the list given above.

>>> print ''.join(test)

TOC

Tips#15. Four Ways To Reverse String/List.

# Reverse The List Itself.

testList = [1, 3, 5]
testList.reverse()
print(testList)

#-> [5, 3, 1]

# Reverse While Iterating In A Loop.

for element in reversed([1,3,5]): print(element)

#1-> 5
#2-> 3
#3-> 1

# Reverse A String In Line.

"Test Python"[::-1]

This gives the output as ”nohtyP tseT”

# Reverse A List Using Slicing.

[1, 3, 5][::-1]

The above command will give the output as [5, 3, 1].

TOC

Hope you liked it.

If you want to learn how to code, taking your first steps into this huge universe might seem like a daunting, if not intimidating task. Here’s the big secret: There are plenty of free (and inexpensive) resources you can use to give yourself all the help you need, teach yourself new techniques, and make this learning process fun and exciting—as exciting as coding can get, at least.

Whether you’re an adult looking to transition into the tech industry, a student looking to learn the latest language, or a hobbyist who just wants to understand how software and services work, all you need is a computer and internet access to start your programming journey. But before you take a flying leap into The Matrix, here are our best tips and resources to set you off on the right foot.

Ask yourself: Why do you want to learn how to code?

Take a few minutes (or a day) to think about the reasons—the real reasons—why you want to learn a programming language. Be honest with yourself. Are you trying to learn the barest minimum to score a promotion? Are you looking to make a big career change? Do you want to create the next greatest app? Thrill your roommates by programming your various smart devices to do something awesome?

Your answer can help determine which programming language(s) you should master, as well as what sort of commitment (in time and money) your goal may require. For example, if your dream is to create the next great operating system or a killer alternative to PhotoShop , you would benefit from a formal computer science education that teaches you C++, as well as more complex topics like data structure, algorithms and memory allocation.

On the other hand, if you’re a mid-career professional looking to transition into a tech career, a short-term coding bootcamp might make more sense than going into debt for a second degree. If all you want to do is build websites or push your Raspberry Pi to its limits, a combination of interactive tutorials and free online courses might be enough to get you going.

Choose the right programming language

Once you figure out why you want to code, you can more easily pinpoint which programming language you should tackle. While there is no single “best” programming language to learn, some languages are more user-friendly than others. HTML and CSS are considered the easiest entry points into the coding world, but they are only really useful for developing basic websites.

For more interactive websites involving payment systems or databases, you’ll need to know Javascript, PHP, SQL, and Python to make all the components sing. Mobile app makers use Swift or C to make iOS apps, and Java or Kotlin for Android apps. Video game developers will turn to Unity, or even C#, to bring their game ideas to life.

Still can’t decide on your starter programming language? Most professionals recommend learning Python, C#, or JavaScript, as they offer the widest utility and career flexibility. To help you make up your mind, check out this great infographic that compares a few popular programming languages.

Above all else, just get started learning something. Once you become comfortable with one programming language, you’ll be able to pick up the next one that much faster—like learning a new musical instrument or foreign language.

Try out some online courses

If you want more control over your learning schedule (or don’t want to go at it alone), an online coding course might be a better option than an in-person coding bootcamp. However, there are many different online classes that teach the same programming languages, and it can be hard to figure out which one is truly worth your time and money.

If you don’t mind practicing solo, check out The Odin Project, a free option that pulls together some of the best open-source content for turning a coding newbie into a programmer.

Thanks to the internet, you don’t have to enroll in a four-year college program to learn the fundamentals of computer science; a number of college-level classes are available online for free (or a nominal fee).

I can’t recommend Harvard’s CS50x Introduction to Computer Science enough. You can audit the course for free via edX and earn a certificate by completing all the assignments, or you can go at your own pace and watch all the lectures posted on Youtube. You can build your own DIY college-level computer science program with this selection of fifteen online courses (many of which are also listed in our Lifehacker U series)

Get a book

The best way to learn to code may involve you getting up-close-and-personal with some dead trees—a real book that you can follow along from beginning to end. In a perfect world, this will give you a more comprehensive introduction to coding than jumping around from topic to topic on a website

You can probably find an e-book for any language or framework you’re trying to learn on GitHub, but many web developers swear by Jon Duckett’s colorful series on everything from front- to back-end web development.

As a self-taught programmer, you might also benefit from books that offer broader advice on the profession. You’ll improve your thinking and habits, traits you can apply to any language you decide to learn. Steve McConnell’s 900-page Code Complete: A Practical Handbook of Software Construction (2nd Edition) is considered the definitive guide for best practices, with data-backed advice on everything from project design to debugging code.

A corollary to that behemoth is Clean Code: A Handbook of Agile Software Craftsmanship by “Uncle Bob” Robert Martin. Martin believes code should be efficiently written for easy testing and scalability, making this a must-read for many modern dev teams.

Since programming is really about problem solving, you’ll appreciate the thought process and “back of the envelope” solutions that Jon Bentley shares in Programming Pearls (2nd Edition). Every chapter ends with a number challenges that are often used in technical job interviews, so make this book part of your job prep.

Check out some interactive tutorials or coding games

Let’s face it: reading lines of code on a screen or in a book can look like gibberish. When you see an example in action, that abstract concept suddenly makes perfect sense. That’s the beauty of interactive coding tutorials you can find around the web.

For example, FreeCodeCamp not only breaks down coding concepts into small chunks within your web browser, it also pairs each concept with a relevant exercise that you have to solve before moving onto the next topic. This way, you can’t just skip ahead to the fun stuff; the site really forces you to debug your code as you learn.

Thank you

HOPE YOU liked IT.