Python fundamental.

Slides:



Advertisements
Similar presentations
Overview of programming in C C is a fast, efficient, flexible programming language Paradigm: C is procedural (like Fortran, Pascal), not object oriented.
Advertisements

Chapter 2, Part 1: An interpreter architecture for C-like languages Xinming (Simon) Ou CIS 505: Programming Languages Kansas State University Fall 2010.
Chapter 3: Beginning Problem Solving Concepts for the Computer Programming Computer Programming Skills /1436 Department of Computer Science.
Principles of Programming Fundamental of C Programming Language and Basic Input/Output Function 1.
CS 330 Programming Languages 10 / 16 / 2008 Instructor: Michael Eckmann.
Arrays. Arrays  When a value is to be used in a program, a variable is declared to hold that value  What about storing the results of exams for a large.
Java An introduction. Example 1 public class Example1 { public static void main (String [] args) { System.out.println (“This is the first example”); int.
Mini-Pascal Compiling Mini-Pascal (MPC) language
Arrays. Arrays  When a value is to be used in a program, a variable is declared to hold that value  What about storing the results of exams for a large.
Testing a program Remove syntax and link errors: Look at compiler comments where errors occurred and check program around these lines Run time errors:
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
CHAPTER 6: PROBLEM SOLVING CONCEPTS FOR THE COMPUTER PROGRAMMING Lec. Ghader R. Kurdi.
Introduction to Python
Variables, Assignment & Math Storing and naming data.
Munster Programming Training
Computing with C# and the.NET Framework Chapter 1 An Introduction to Computing with C# ©2003, 2011 Art Gittleman.
INTRODUCTION TO JAVA CHAPTER 1 1. WHAT IS JAVA ? Java is a programming language and computing platform first released by Sun Microsystems in The.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
Arithmetic Operations. Review function statement input/output comment #include data type variable identifier constant declaration.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
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.
What on Earth? LEXEMETOKENPATTERN print p,r,i,n,t (leftpar( 4number4 *arith* 5number5 )rightpar) userAnswerID Letter followed by letters and digits “Game.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
1 Review. 2 Creating a Runnable Program  What is the function of the compiler?  What is the function of the linker?  Java doesn't have a linker. If.
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Lecture 04 – Models of memory Mutable and immutable data.
1 12/4/1435 h Lecture 2 Programs and Programming Languages.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
Concepts of programming languages Chapter 5 Names, Bindings, and Scopes Lec. 12 Lecturer: Dr. Emad Nabil 1-1.
1 Chapter 2: Java Fundamentals cont’d Spring Lory Al Moakar.
Python Programming Lecture II. Data Data is the raw material that programs manipulate. Data comes in different flavours. The basic ones are called “primitive.
Arrays. Topics to be Covered... Arrays ◦ Declaration ◦ Assigning values ◦ Array manipulation using loops Multi-dimensional arrays ◦ 2D arrays ◦ Declaration.
POINTERS IN C. Introduction  A pointer is a variable that holds a memory address  This address is the location of another object (typically another.
COP 2551 Introduction to Object Oriented Programming with Java Topics –Introduction to the Java language –Code Commenting –Java Program Structure –Identifiers.
Topics for today: 1.Comments 2.Data types 3.Variable declaration.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Agenda Introduction Computer Programs Python Variables Assignment
Whatcha doin'? Aims: To start using Python. To understand loops.
BASIC ELEMENTS OF A COMPUTER PROGRAM
Topic: Python’s building blocks -> Variables, Values, and Types
Types and Values.
Objectives Identify the built-in data types in C++
C# and the .NET Framework
CS230 Tutorial Week 3.
Introduction to C++.
Lecture Note Set 1 Thursday 12-May-05
Java Programming: From Problem Analysis to Program Design, 4e
Arrays, For loop While loop Do while loop
Building Java Programs Chapter 2
Chapter 2 Elementary Programming
Introduction to Python
Advanced Programming Basics
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
Chapter 2: Java Fundamentals
Statements and expressions - java
Building Java Programs
Variables variable: A piece of the computer's memory that is given a name and type, and can store a value. Like preset stations on a car stereo, or cell.
Reference semantics, variables and names
Variables In today’s lesson we will look at: what a variable is
Intro to Programming Concepts
Python Basics with Jupyter Notebook
C Programming Pointers
JavaScript: Introduction to Scripting
Lexical Elements & Operators
C Programming Lecture-3 Keywords, Datatypes, Constants & Variables
WJEC GCSE Computer Science
Variables and Constants
Introduction to Pointers
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Python fundamental

Python tokens In a passage of text, individual words and punctuation marks are called tokens or lexical units or lexical elements. The smallest individual unit in a program is known as a Token or a lexical unit. Types of tokens:- Keywords Identifiers Literals Operators Punctuators

Variables and assignments A Python variable is a reserved memory location to store values. In other words, a variable in a pythonprogram gives data to the computer for processing. Every value in Python has a datatype. Different data types in Python are Numbers, List, Tuple, Strings, Dictionary, etc. Declare a variable:-We will declare variable "a" and print it.           print a Multiple assignments:- Assigning same value to multiple variables                             Ex: a=b=c=10 2.   Assigning multiple values to multiple variables                             Ex: x,y=10,20

Variable defination It means that a variable is not created until some value is assigned to it. In other words you can say that the defination of the variable has to be given before the other operations it is used in. For ex:-(# is for comment not in code) # error code Print(x) X=10 # correct code

Dynamic typing When we declare a variable in C or alike languages, this sets aside an area of memory for holding values allowed by the data type of the variable. The memory allocated will be interpreted as the data type suggests. If it’s an integer variable the memory allocated will be read as an integer and so on. When we assign or initialize it with some value, that value will get stored at that memory location. At compile time, initial value or assigned value will be checked. So we cannot mix types. Example: initializing a string value to an int variable is not allowed and the program will not compile. But Python is a dynamically typed language. It doesn’t know about the type of the variable until the code is run. So declaration is of no use. What it does is, It stores that value at some memory location and then binds that variable name to that memory container. And makes the contents of the container accessible through that variable name. So the data type does not matter. As it will get to know the type of the value at run-time.

MADE BY:- CHETANYA SHARMA The end MADE BY:- CHETANYA SHARMA