I will be showing more examples of indexing and slicing as a form of my practice to familiarize this. From the previous lesson/posts, the syntax for slicing as follows: string[start : end : step] Example1: (Indexing and Slicing in Strings) W r i t e C o d e O n l i n e…

# Tag: python

## Python>>Data Type:Strings

Strings are text type and are sequences of character data. It is represented by quotation marks, either single or double quotes. Example: “Hello” ‘What is your name?’ >>> “Hello” ‘Hello’ >>> x = ‘What is your name?’ >>> print (x) What is your name? >>> Some key notes: 1.Escape sequences in strings = use backslash…

## Python>>Data Type:Float

Floating point number is real numbers with decimal point (.)or fractional part. It can be positive or negative. Example: 5678.90 -2.88 0.99 >>> z = -1.234 >>> type(z) <class ‘float’> Let’s do arithmetic: >>> x = 8+8.1 >>> print (x) 16.1 >>> print (type(x)) <class ‘float’> Some key notes: 1. numbers separated with underscore can…

## Python>>Data Type:Integer

Integers or Int are whole numbers without the decimal point or fractional part. It can be positive or negative or zero.It can be binary, octal or hexadecimal values. Let’s do mathematical calculation: Arithmetic operators: addition = + subtraction = – multiplication = * division = / modulus = % exponent = ** floor division…

## Basic Data Types in Python

There are few data types in Python namely: integers (int) – numeric type, whole numbers (can be positive or negative), e.g. 1,2,3 floating (float) – numeric type,numbers with decimal point, e.g. 1.1, 2.20, 3.450 complex (complex) – numeric type, real + imaginary,e.g. 5+6q strings (str) – text type, sequences of characters,e.g. “Euan”, “1234” dictionaries…

## Python: Show me the Tools

Trying to document as much as possible on what tools or apps am I going to use to learn Python.I’m running dual boot OS on my laptop and I switch once in a while OS: Windows 10 Pro 64-bit Ubuntu Linux 20.04 LTS Kernel 5.110-25-generic x86_64 Tools: Jupyter Notebook via Anaconda.com (Individual Edition) it comes…