Python Condition

if and if else tech justice
Python if...elif...else and Nested if  Decision making is required when we want to execute a code only if a certain condition is satisfied. The if…elif…else statement is used in Python for decision making. Python if Statement Syntax Here, the program evaluates the test expression and will execute statement(s)...

Python Operator Overloading

Python-Operator-Overloading
Python operators work for built-in classes. But same operator behaves differently with different types. For example, the + operator will, perform arithmetic addition on two numbers, merge two lists and concatenate two strings. This feature in Python, that allows same operator to have different...

Get the Geo Location of an IP Address Python

python Get the Geo Location of an IP Address Python tech justice.jpg
Geolocate an IP address based on input from the user. For this script, we will be using a bunch of Python modules to accomplish this. First we make a check to see that the user puts in enough arguments, and if not, they 'usage'...

Replace String in Python

Replace String in Python tech justice
Often you'll have a string (str object), where you will want to modify the contents by replacing one piece of text with another. In Python, everything is an object - including strings. This includes the str object. Luckily, Python's string module comes with a...

Python Generators

Python-Generator-Tech-Justice
There was a lot of overhead in building an iterator in Python; we had to implement a class with__iter__() and __next__() method, keep track of internal states, raise StopIteration when there was no values to be returned etc. This is both lengthy and counter...

Make Simple Calculator Program in Python

python-calculator tech justice
In this program, we ask the user to choose the desired operation. Options 1,2,3 and 4 are valid. Two numbers are taken and an if...elif...else branching is used to execute a particular section. User-defined functions add(), subtract(), multiply() and divide() evaluate respective operations. Source Code Output  

Python while Loop

Python-while-Loop-Tech-Justice
The while loop in Python is used to iterate over a block of code as long as the test expression (condition) is true. We generally use this loop when we don't know beforehand, the number of times to iterate. Syntax of while Loop In while loop,...

Python Identifier and Keywords

Python Keywords and Identifier Tech Justice
Keywords Keywords are the reserved words in Python. We cannot use a keyword as variable name, function name or any other identifier. They are used to define the syntax and structure of the Python language. In Python, keywords are case sensitive. There are 33 keywords in...

Search Twitter’s Tweeted Tweet By Python

Search Twitter's Tweeted Tweet - tech justice
Overview Twitter's API is REST-based and will return results as either XML or JSON, as well as both RSS and ATOM feed formats. Public timelines can be accessed by any client, but all other Twitter methods require authentication. About this script The program is well documented and...

Verify Age With PHP DateTime

Verify Age With PHP Datetime
There are times when a site needs to check the age of a person, usually for legal reasons. This small script shows how to check a person is of a given age, including leap years. Buy using the PHP DateTime class, php is able...

Deals

Best Budget Phone of 2017

If you’ve shopped for a budget phone recently, you know just how challenging an undertaking it can be. While most phones around the $200...
TECHJUSTICE

Meizu m1 Note M463

asus zenfone 2 tech justoce

ASUS ZenFone 2

Editor's Choice

htc root

HTC Quick Root for all HTC Devices

Here is One Click Root and UnRoot solution for ALL HTC Devices. Note that the Insecure Boot.img method is for all devices but requires...
oneplus_3_t_tech justice

How to Unbrick OnePlus 3T