Anna GE 8151 - Python Basics Tutorial

Unformatted text preview:

Python Basics Tutorial Python is a general purpose programming language which can be used for almost anything may it be to develop web pages or for machine learning or any sort of simple application Python has you covered so you would wonder where did it all start in the 1980s Python has gained popularity recently with the rise of machine learning and artificial intelligence as Python makes code writing easy and efficient Python is an open source language which means that it is free for anybody to use Python allows you to add the code of those particular languages within itself which makes python all the more powerful with that Python also supports oops meaning that you can model a real world problem into your code and you can have security for it Python is a really important language and there are a huge number of companies who use it around the world The National Security Agency uses Python for cybersecurity analysis and also for encryption and decryption purposes NASA scientists at NASA used Python to perform scientific calculations Netflix uses machine learning to cluster certain groups of its users and recommend TV shows to detain them Let us go ahead and see how to work with patch um and write a few programs with pycharm you can download either the professional version or the community version for the purpose of the tutorial I will be downloading the community community version because it is free but if you want you can even go ahead to download the professional version for a certain amount of fee I already have py charm installed in my computer PyCharm python v6 open so as you can see I have all the different topics that we will be covering the data types file handling flow control functions operators all of this so let me just come out of the presentation mode now let us move ahead with the next part of our tutorial so I hope all of you are clear with this The first data type is the numeric data type which is used to store the numeric values The other thing that you have to remember are that numeric data types are not mutable There are six data types in Python so there are six so we have numeric lists tuples tuples dictionary sets and strings Type conversions are basically used to convert a data type from one form to another so let me go ahead and show you some of the more functions that are available to you which you can use for type conversions The type conversions that you follow are called as explicit type conversions and the type conversions are called explicit type conversion is done by faith in itself so it converts the a which is an integer into a floating number Python does implicit type conversions that Python does by itself are called as implicit type conversion type conversions can be used to convert data into an integer or an octagonal number Python does these types of conversions by itself and they are called implimplicit type conversions so I hope all of you have understood so far Lists are the same as arrays with one exception that they can have different data items inside them arrays would only have a particular data item within them Lists are mutable meaning that you can change particular items in the list indexes are basically the address in which the data is stored in Python How do you access the elements of the list it is done using splicing so splicing always has a starting index it has an ending index and it also has a skip index If I want to access a particular element I have to pass the index value of it so if I have the element 2 it is stored at the index 1 so the address always starts with 0 up till how many ever numbers you have The skip index is something called as the skip index right now I start from 0 go up till 5 then skip two elements meaning that I print 1 I skip one and I skip 2 I skip ed Eureka and I print Python so that is how you have obtained the output next is the third element and the second next the next is I can also access particular elements within the elements Python is basically how you can add elements to your lists If I am printing all of this it does not change the actual data will not be changed so as you can see over here I have one accordingly and then multiplication is multiplying the list accordingly to the number you have told it to be multiplied with so the whole list will be multiplied two times


View Full Document

Anna GE 8151 - Python Basics Tutorial

Download Python Basics Tutorial
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Python Basics Tutorial and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Python Basics Tutorial 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?