Python : Variables, Data Types, Boolean & Operators

Code Variable-1

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

 

Code Variable 2
Facebook
Twitter
LinkedIn
Pinterest
Categories

Leave a Reply

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

Happy Coding with Brittany-

GRADES 1-2 STARTS DECEMBER 15. EVERY TUESDAY AT 6 PM FOR 4 WEEKS. FREE FOR PUBLIC SCHOOLS, LIBRARIES, HOMESCHOOLS.

GRADES K

Hello everyone! My name is Brittany, and I am a Co-founder and instructor for Happy Code Club. In this class, we are going to learn the basics of Scratch to start your coding journey! We will break down coding concepts in a way that is easier to understand through a series of fun, creative, and engaging projects that are all created the way you want! It is your creative masterpiece. Students will have access to a recording for each class in case they want to rewatch the class or weren’t able to attend on a specific day. We will all learn coding together!
Technology required: Wifi, Chromebook, pc, or mac, two button mouse is recommended. (no tablets please). Registration is open through Dec 13 so don’t hesitate and register now. Please feel free to email brittany@happycodeclub.com if you have any questions, comments, or concerns!

Happy Coding with Brittany-

GRADES K STARTS DECEMBER 15. EVERY TUESDAY AT 5 PM FOR 4 WEEKS. FREE FOR PUBLIC SCHOOLS, LIBRARIES, HOMESCHOOLS

GRADES K

Hello everyone! My name is Brittany, and I am a Co-founder and instructor for Happy Code Club. In this class, we are going to learn programming through a very kid-friendly app and other resources to get their brains thinking about code. We will create a variety of projects using basic block codes and play games that focus on problem solving and critical thinking. This program is designed to be the very first step in their coding journey without being overwhelming or too
advanced! We will all learn coding together!
Technology required: Tablet only. Registration is open through Dec 13 so don’t hesitate and register now. Please feel free to email brittany@happycodeclub.com if you have any questions, comments, or concerns!

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