- Sep 2020
-
greenteapress.com greenteapress.com
-
Chapter 12Tuples
tuples is a sequence of values this can be anytype and they are indexed by integers and tuples are immutable in().operations like addition ,multiplication works on tuples.they can return multiple values. Tuples are immutable which means you cannot update or change the values of tuple elements. An operation that collects multiple arguments into a tuple is known as gather. an operation that makes a sequence behaves like multiple arguments is known as scatter. .And the tuples we cannot modify the values. and we can assign the values to the tuples.
-
Chapter 10Lists
like a strings here lists is a sequence of values in a list that may be any type this values in a list are called elements and list can have different data types Strings are need to be given in single or double codes.And also Strings are immutable which means a string cannot be updated.And another important topic from strings is Slicing of a string which means we can obtain the substring from the given string by following a syntax.
-
Chapter 8Strings
strings is a sequence of characters you can acess the characters at once in bracket opertater ,fruit ='banana' String should be given in single or double codes.Strings are immutable.once we create a string we cannot make any changes in them .We declare strings using square brackets.A segment of a string is called a slice.Many built in functions can be used len(),upper(),lower(),etc.We can use len() function to find length of a string.We can even compare two strings==(equal).The expression in brackets
-