SOFT 161. Class Meeting 1.6

Similar documents
Key Differences Between Python and Java

CSI33 Data Structures

CHAPTER 2: Introduction to Python COMPUTER PROGRAMMING SKILLS

Software and Programming 1

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

Tester vs. Controller. Elementary Programming. Learning Outcomes. Compile Time vs. Run Time

Elementary Programming

IT 374 C# and Applications/ IT695 C# Data Structures

Computational Expression

Basics of Java Programming

Introduction to Python

COMP 111. Introduction to Computer Science and Object-Oriented Programming. Week 2

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Software and Programming 1

Chapter 2: Using Data

Typescript on LLVM Language Reference Manual

Entry Point of Execution: the main Method. Elementary Programming. Learning Outcomes. Development Process

Visual C# Instructor s Manual Table of Contents

1 Lexical Considerations

Full file at

SSOL Language Reference Manual

Basic Syntax - First Program 1

Computer Programming : C++

LECTURE 02 INTRODUCTION TO C++

Java Bytecode (binary file)

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.

ENGR 101 Engineering Design Workshop

Datatypes, Variables, and Operations

FRAC: Language Reference Manual

DEPARTMENT OF MATHS, MJ COLLEGE

Lexical Considerations

VENTURE. Section 1. Lexical Elements. 1.1 Identifiers. 1.2 Keywords. 1.3 Literals

Python Unit

Entry Point of Execution: the main Method. Elementary Programming. Compile Time vs. Run Time. Learning Outcomes

Chapter 2: Introduction to C++

Chapter 2: Special Characters. Parts of a C++ Program. Introduction to C++ Displays output on the computer screen

Object-Oriented Programming

Object oriented programming. Instructor: Masoud Asghari Web page: Ch: 3

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic

CSC Web Programming. Introduction to JavaScript

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

Full file at C How to Program, 6/e Multiple Choice Test Bank

Standard 11. Lesson 9. Introduction to C++( Up to Operators) 2. List any two benefits of learning C++?(Any two points)

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary

The C++ Language. Arizona State University 1

CSCE 110 Programming I Basics of Python: Variables, Expressions, Input/Output

CSCI 2010 Principles of Computer Science. Data and Expressions 08/09/2013 CSCI

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

Data and Expressions. Outline. Data and Expressions 12/18/2010. Let's explore some other fundamental programming concepts. Chapter 2 focuses on:

4. If the following Java statements are executed, what will be displayed?

Interpreted vs Compiled. Java Compile. Classes, Objects, and Methods. Hello World 10/6/2016. Python Interpreted. Java Compiled

PYTHON- AN INNOVATION

Introduction to C# Applications

Java Notes. 10th ICSE. Saravanan Ganesh

Program Fundamentals

DM550 / DM857 Introduction to Programming. Peter Schneider-Kamp

COMP519 Web Programming Lecture 17: Python (Part 1) Handouts

BITG 1233: Introduction to C++

Lexical Considerations

Welcome to Python 3. Some history

RTL Reference 1. JVM. 2. Lexical Conventions

Course Outline. Introduction to java

Programming Syntax and Style. David Greenstein Monta Vista High School

Introduction To Java. Chapter 1. Origins of the Java Language. Origins of the Java Language. Objects and Methods. Origins of the Java Language

CS313D: ADVANCED PROGRAMMING LANGUAGE

COMP 202 Java in one week

Fundamental of Programming (C)

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

DaMPL. Language Reference Manual. Henrique Grando

Programming with Java

egrapher Language Reference Manual

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

cis20.1 design and implementation of software applications I fall 2007 lecture # I.2 topics: introduction to java, part 1

BTE2313. Chapter 2: Introduction to C++ Programming

Flow Control. CSC215 Lecture

CHIL CSS HTML Integrated Language

Introduction to Java Applications; Input/Output and Operators

2/29/2016. Definition: Computer Program. A simple model of the computer. Example: Computer Program. Data types, variables, constants

And Parallelism. Parallelism in Prolog. OR Parallelism

Full file at

Creating a C++ Program

Lecture 2: Variables and Operators. AITI Nigeria Summer 2012 University of Lagos.

Oct Decision Structures cont d

JAVA Programming Fundamentals

Introduction to Bioinformatics

Procedures, Parameters, Values and Variables. Steven R. Bagley

( &% class MyClass { }

Language Fundamentals Summary

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

YOLOP Language Reference Manual

! A literal represents a constant value used in a. ! Numbers: 0, 34, , -1.8e12, etc. ! Characters: 'A', 'z', '!', '5', etc.

Midterm I - CSE11 Fall 2013 CLOSED BOOK, CLOSED NOTES 50 minutes, 100 points Total.

Chapter 2: Basic Elements of C++

CIS133J. Working with Numbers in Java

Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction

Transcription:

University of Nebraska Lincoln Class Meeting 1.6 Slide 1/13

Overview of A general purpose programming language Created by Guido van Rossum Overarching design goal was orthogonality Automatic memory management Support for OO programming (and other paradigms) Less cluttered grammar Many libraries and frameworks to support app development Slide 2/13

Overview of Kivy Open-source library for user interface development Provides support for mouse, keyboard, and other input devices Implements the main loop of an application Similar to the FX library for Kv language describes the user interface and user interactions Slide 3/13

Comments // A comment # A comment A comment begins with a double slash A comment begins with the hash character Slide 4/13

Naming Conventions class MyClass {... } class MyClass(object): makemove(...) make_move(...) firstnumber = 4; first_number = 4 Camel case for classes, methods, and variable names. Camel case for classes but underscores for methods and variable names. Slide 5/13

Variables int length = 5; length = 5 Names are bound to a type No type declaration names at compile time (i.e., static are bound to a type at run typing) time (i.e., dynamic typing) Slide 6/13

Literals true, false Boolean literals are lowercase True, False Boolean literals are uppercase Slide 7/13

Operators <, >, <=, >= <, >, <=, >= +, -, *, % +, -, *, % / /, //!, &&, not, and, or No distinction between floating-point and integer division Different operators for floating-point and integer division Logical operators written in symbols Logical operators written in words Slide 8/13

Assignment Statements x = 1; x = 1 x += 1; x += 1 ++x; x += 1 Semicolons terminate statements Line breaks terminate statements Increment and decrement operators available Increment and decrement operators not available Slide 9/13

If Statements if (x < 0) { if x < 0: System.out.println("<"); print("<") } else if (x == 0) { elif x == 0: System.out.println("="); print( = ) } If statements use colons, indentation, If statements use braces and the abbreviated spelling elif Strings can be written Strings are written in double in single or double quotes quotes Slide 10/13

Methods void foo(int number) { x = x + y; } Functions are not marked by a keyword Indentation is only used to improve human readability Types are specified in signatures Functions must be inside a class def foo(number): x = x + y Functions are marked by def Indentation level is significant Types are not specified in signatures Functions may exist outside of a class Slide 11/13

Methods void addx(int x) { def add_x(self, x): } pass The this parameter is The self parameter is implicit explicit and comes first Empty blocks simply pass is a placeholder for an contain no code empty block Slide 12/13

Field Access class NimApp { class NimApp(object): public int x;...... void computex() { def compute_x(self): x += 5; self.x += 5 } Instance fields must be Instance fields are not declared declared Instance fields can be Instance fields must be referenced without the this referenced with the self keyword keyword Slide 13/13