Posts

Showing posts from February, 2019

Loops and Cases in Python

Image
In this article I am sharing information regarding basic loops with some small cases. Information includes if else cases, for loop with range option, while with break and continue key words. def main() :  #iF and else cases with and or conditions EmployeeAge=22 StudentAge=23 WorkerAge=25 if EmployeeAge > StudentAge :  print("Employee is Older") else : print("Student is Older") if EmployeeAge > StudentAge and StudentAge > WorkerAge : print("Employee is older") elif StudentAge > EmployeeAge and EmployeeAge > WorkerAge : print("Student is Older") elif WorkerAge > EmployeeAge and EmployeeAge > StudentAge : print("Worker is Older") elif StudentAge == EmployeeAge :  print("Student and Employee have same age") elif EmployeeAge > StudentAge or EmployeeAge > WorkerAge : print("Employee is older then Student or Worker") else :  print("Sh...

Collections List Tuple Set Dictionary in Python

Image
Collections (Arrays) : There are four collection data types in the Python programming language: List is a collection which is ordered and changeable. Allows duplicate members. Tuple is a collection which is ordered and unchangeable. Allows duplicate members. Set is a collection which is unordered and unindexed. No duplicate members. Dictionary is a collection which is unordered, changeable and indexed. No duplicate members. To work with collection type, it is useful to understand the properties of that type. Choosing the right type for a particular data set could mean retention of meaning, and, it could mean an increase in efficiency or security. List : A list is a collection which is ordered and changeable. In Python lists are written with square brackets. def main() :  lstEmployee = ["sharjeel", "GOPESH PANDEY", "Rupak"] print(lstEmployee) #You access the list items by referring to the index number print(lstEmployee[1]) #To cha...

Indentations Variables Variable Type Variable Type Casting in Python

Image
I am sharing my little experience on Python programs. These are basic and helpful for beginners. First install python from https://www.python.org/downloads/ After download I install at below location(optional) Now I created a BasicProgram.py file to write python program on same location(optional). You can change file location as per your cod collections. Print a string in Python def main(): #print something on console print ("This is Sharjeels Work!") main() To run this program go to location where BasicProgram.py file is placed and write command as in above program main is a method to start the program and # is used for single line comment only. Print method used to print on console. Few more basic operation on string like upper case , lower case conversion, getting string length, split string, remove white space etc. def main() :  employeeName=" sharjeel-bilali " #Get the character at position 3 (remember that the first character...

Angular 6 Installation And Setup

Image
Prerequisite to install and setup Angular 6 on Windows systems. Nodejs Npm Angular CLI IDE for writing your code It’s required for Angular 6 that Nodejs should have version greater than 8.11 and npm has to be greater than 5.6. Nodejs Identify the nodejs is installed on your system with typing command  node -v  in the cmd prompt. This will help you see the version of nodejs currently installed on your system. If it does not print anything, install nodejs on your system. To install nodejs, go the homepage  https://nodejs.org/en/download/  of nodejs and install the package based on your OS. Official site’s homepage of nodejs will look like the following – To install   node on Windows 10, I downloaded node-v10.15.3-x64.msi from nodejs.org site. Run this msi file and follow the required step to install. Once nodejs is installed, npm will also get installed ...