Nate Brunelle Today: Strings, Type Casting

Slides:



Advertisements
Similar presentations
For(int i = 1; i
Advertisements

Syscall in MIPS Xinhui Hu Yuan Wang.
Variables and I/O. Types Strings –Enclosed in quotation marks –“Hello, World!” Integers –4, 3, 5, 65 Floats –4.5, 0.7 What about “56”?
Variables and I/O. Types Strings –Enclosed in quotation marks –“Hello, World!” Integers –4, 3, 5, 65 Floats –4.5, 0.7 What about “56”?
CS 1 with Robots Variables, Data Types & Math Institute for Personal Robots in Education (IPRE)‏
Strings CS303E: Elements of Computers and Programming.
Variables When programming it is often necessary to store a value for use later on in the program. A variable is a label given to a location in memory.
CSC1201: Programming Language 2 Lecture 1 Level 2 Course Nouf Aljaffan (C) CSC 1201 Course at KSU1.
CS 1 with Robots Variables, Data Types & Math Institute for Personal Robots in Education (IPRE)‏ Sec 9-7 Web Design.
Introduction to Java Primitive Types Operators Basic input and output.
INPUT & VARIABLES.
“Great leaders are never satisfied with current levels of performance. They are restlessly driven by possibilities and potential achievements.” – Donna.
A: A: double “4” A: “34” 4.
Values, Types, and Variables. Values Data Information Numbers Text Pretty much anything.
Data Manipulation Variables, Data Types & Math. Aug Variables A variable is a name (identifier) that points to a value. They are useful to store.
Literals A literal (sometimes called a constant) is a symbol which evaluates to itself, i.e., it is what it appears to be. Examples: 5 int literal
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
CPSC 233 Tutorial January 21 st /22 nd, Linux Commands.
Input, Output and Variables GCSE Computer Science – Python.
Hello Educational presentation.
Introduction to Programming
Formatted Input/Output
Intro to CS Nov 2, 2015.
Topic: Python’s building blocks -> Variables, Values, and Types
CPS120: Introduction to Computer Science
CPS120: Introduction to Computer Science
Types and Values.
Introduction to Python Data Types and Variables
Chapter 3: I/O Management
Formatting Output.
Lecture Note Set 1 Thursday 12-May-05
Java Generics Lecture 17 CS2110 – Spring 2017
Formatted Input/Output
OUTPUT STATEMENTS GC 201.
CS 1428 Exam I Review.
Nate Brunelle Today: Repetition, Repetition
Compilers B V Sai Aravind (11CS10008).
Nate Brunelle Today: Slicing, Debugging, Style
Nate Brunelle Today: Functions again, Scope
Changing one data type into another
Variables and Expressions
Escape sequences escape sequence: A special sequence of characters used to represent certain special characters in a string. \t Inserts a tab in the.
Nate Brunelle Today: Regular Expressions
Variables, Data Types & Math
Nate Brunelle Today: Values and Types
Nate Brunelle Today: Conditional Decision Statements
CS150 Introduction to Computer Science 1
Variables, Data Types & Math
Nate Brunelle Today: Lists
Nate Brunelle Today: Lists
Nate Brunelle Today: Dictionaries
LING 408/508: Computational Techniques for Linguists
Nate Brunelle Today: Functions
CS1110 Today: collections.
ECE 103 Engineering Programming Chapter 51 Random Numbers
Nate Brunelle Today: Strings, Type Casting
Nate Brunelle Today: Values and Types
Nate Brunelle Today: Conditional Decision Statements
Comments Any string of symbols placed between the delimiters /* and */. Can span multiple lines Can’t be nested! Be careful. /* /* /* Hi */ is an example.
Variables, Data Types & Math
CSE 231 Lab 3.
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
Nate Brunelle Today: Dictionaries
Nate Brunelle Today: Conditional Decision Statements
Nate Brunelle Today: Functions
Nate Brunelle Today: Style, Collections
Nate Brunelle Today: Functions again, Scope
Nate Brunelle Today: Web Reading
CS 1428 Exam I Review.
Getting Started in Python
Presentation transcript:

Nate Brunelle Today: Strings, Type Casting CS1110 Nate Brunelle Today: Strings, Type Casting

PAs, OHs

Questions?

Last Time Values, types, operators

Values A “thing” Every value has a type

Values and Types (not exhaustive) Operators -50 ,0 ,5, 30, 512 int 3+7, 3*7, 3-7, 3/7 0.5, 1.2, 0.333333 float +, *, -, / ‘hi’, “hi”, ‘hello world! ✃’ str +, *int Print, input function print()

How to write strings ‘ “ “”” ‘’’

Escape Sequence Format: \? Says “the normal rule should not apply to this character = ?” \’ \” \n

Casting “Reshape” a value of one type to become another type: Functions for casting: General: type(value) int(‘7’) -> the int 7 str(7) -> the str ‘7’ float(‘7.0’)-> the float 7.0 type(value) gives the type of the value

Race_boaster