Mindmap
Programming Basics
Inhalt der Mindmap
Programming Basics
Data Types
- Programming languages have five main data types
- Integer, Real, Boolean, Character, String
- Whole numbers only (integer)
- Real (Numbers that have a decimal part)
- Boolean (Can only take one of two values, usually TRUE or FALSE)
- Character (A single letter)
- String ( Used to represent text, it is a collection of characters
- Character (A single letter)
- Boolean (Can only take one of two values, usually TRUE or FALSE)
- Real (Numbers that have a decimal part)
- Whole numbers only (integer)
- Integer, Real, Boolean, Character, String
- Each data type is allocated to a different type of memory.
- Using the correct data types makes code more memory efficient, robust and predictable
- Languages have functions that let you manually convert between data types, this is known as casting
- Casting is used to change the data type
- int(), float(), bool(), str()
- Programming languages have five main data types
Strings
- Strings are a data type made up of characters
- Characters are alphanumeric (letters, numbers, spaces, symbols, etc.)
- Strings are usually written inside double quotation marks.
- Sometimes single quotes are used.
- Strings can be joined together to form new strings, this is called concatenation.
- Often done using the + operator
- Programs let you manipulate strings in a variety of ways.
- String manipulation functions:
- x.upper
- x.lower
- x.length
- x[i]
- x.subString(a, b)
- Extracts a string starting at position A with length B from string x.
- Extracts all the character in position i in string x
- x.subString(a, b)
- Returns the number of characters in string x
- x[i]
- Changes all characters in string x to lower case
- x.length
- Changes all characters in string x to upper case
- x.lower
- x.upper
- String manipulation functions:
- Strings are a data type made up of characters
Informationen
- Beschreibung
- Mindmap am Programming Basics, erstellt von Avni Bhatt am 06/06/2019.
- Erstellt von
- Avni Bhatt
- Aufrufe
- 0
- Bewertung