Python : Variables, Data Types, Boolean & Operators

varible

Basic Foundation Concepts - Project 3

In this program the basic python such as comments , varibles, Data Types, Booleans and operations are explained with examples. 

The int() function converts the specified value into an integer number. 

      int(value, base) -syntex

Creating Variables : Variables are containers for storing data values.Unlike other programming languages, Python has no command for declaring a variable.A variable is created the moment you first assign a value to it. 

String Literals

String literals in python are surrounded by either single quotation marks, or double quotation marks.

‘hello’ is the same as “hello”.

You can display a string literal with the print() function:

example :

print(‘in 2020, you will be’, 2020 -int3)
counter = 100
miles = 1000.0
name = “john”

Built-in Data Types In programming, data type is an important concept.Variables can store data of different types, and different types can do different things.Python has the following data types built-in by default, in these categories:

Text Type:

str

Numeric Types:

int, float, complex

Sequence Types:

list, tuple, range

Mapping Type:

dict

Set Types:

set, frozenset

Boolean Type:

bool

Binary Types:

bytes, bytearray, memoryview

Python Arithmetic Operators:

 

Operator

Name

Example

+

Addition

x + y

Subtraction

x – y

*

Multiplication

x * y

/

Division

x / y

%

Modulus

x % y

**

Exponentiation

x ** y

//

Floor division

x // y

 

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest
Categories

Leave a Reply

Your email address will not be published. Required fields are marked *

Happy Coding with Brittany-

Game Design with Scratch Jr.

Grades: 3-5

Introduction to programming with Scratch will show you around the interface and have you making a fun project in minutes. This easy to learn program is super fun as it allows you to create artistic characters, scenes, and objects and animate them with computer code.
If you are curious about what coding is or simply want to try something new, this is a fun class to try. See why millions of students from around the world are sharing their awesome creations on the Scratch platform. The creations students make range from Stories, Games, animations, music and more! Get your creativity hats on and come and check this out!

Technology Requirements: Chromebooks or PC or Mac with wifi and a two button mouse recommended.

Links to class tools used Scratch Zoom Client installation

Prerequisites: No previous experience necessary. Ability to use a two button mouse; ability to hold objects on the screen and move them with left mouse button and keyboarding isrecommended.

Happy Coding with Fernando-

Intro to Game Design in Scratch

Grades: 3-5

Introduction to programming with Scratch will show you around the interface and have you making a fun project in minutes. This easy to learn program is super fun as it allows you to create artistic characters, scenes, and objects and animate them with computer code.
If you are curious about what coding is or simply want to try something new, this is a fun class to try. See why millions of students from around the world are sharing their awesome creations on the Scratch platform. The creations students make range from Stories, Games, animations, music and more! Get your creativity hats on and come and check this out!
Technology Requirements: Chromebooks or PC or Mac with wifi and a two button mouse recommended. Links to class tools used Scratch Zoom Client installation
Prerequisites: No previous experience necessary. Ability to use a two button mouse; ability to hold objects on the screen and move them with left mouse button and keyboarding is recommended.

Happy Coding

Winter Dates: Nov 30 – Jan 28

This winter join students from other schools in a zoom class that you can take from your school or home.
This after school club is free for public schools classrooms Grades 3-5 and it will be run for 6-8 weeks in Winter and Spring of 2021 Taught by Happy Code Club teachers with experience in various subjects including Scratch, Python, codehs.com, code.org, Robotics and more.
Winter Dates: Nov 30 – Jan 28