Top Banner
halo dear suneet i your letter receive days ago about 2. i wait for you impatent. taday i go to park and had lots fun with new frends. i play minecraft every day while waiting for ur return. sending mi moust resent fotograf yours trully, Dobby the House Elf
35

Python Programming: Variables

Jul 19, 2015

Download

Software

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Python Programming: Variables

halo dear suneet!i your letter receive days ago about 2. i wait for you impatent. taday i go to park and had lots fun with new frends. i play minecraft

every day while waiting for ur return. sending mi moust resent fotograf!

yours trully,!Dobby the House Elf

Page 2: Python Programming: Variables
Page 3: Python Programming: Variables

Syntax

the arrangement of words and phrases to create well-formed sentences in a language.

Page 4: Python Programming: Variables
Page 5: Python Programming: Variables
Page 6: Python Programming: Variables
Page 7: Python Programming: Variables
Page 8: Python Programming: Variables
Page 9: Python Programming: Variables

Variables

Page 10: Python Programming: Variables

my_name

my_name

my_name

=

=

=

“Leena”

“Spongebob”

100

Variable Assignment

my_name = Leena

Page 11: Python Programming: Variables
Page 12: Python Programming: Variables

dessert “cake”=

Page 13: Python Programming: Variables

dessert 5=

Page 14: Python Programming: Variables

dessert cake=

Page 15: Python Programming: Variables

dessert cake=cake = “muffin”

Page 16: Python Programming: Variables

greeting “Hello!”=

Page 17: Python Programming: Variables

rohins_age 10=

Page 18: Python Programming: Variables

ice_cream_price 2.50=

Page 19: Python Programming: Variables

number_of_pets 2 + 4=

Page 20: Python Programming: Variables

number_of_pets 3*2+4=

Page 21: Python Programming: Variables

number_of_pets 3*(2+4)=

Page 22: Python Programming: Variables

number_of_pets 3*(2+4)/2=

Page 23: Python Programming: Variables

number_of_pets 3*((2+4)/2-1)=

Page 24: Python Programming: Variables

koena = (3*2-1)/(2/2+2*2)-7

Page 25: Python Programming: Variables

sam = 5ishaan = sam + 2

Page 26: Python Programming: Variables

sam = 5

ishaan = sam + 2

Page 27: Python Programming: Variables
Page 28: Python Programming: Variables

Variable Names Can Contain:

Uppercase Letters: A B C D…

Lowercase Letters: a b c d…

Numbers: 1 2 3 4…

Underscore Symbol: _

*They can’t begin with a number

Page 29: Python Programming: Variables
Page 30: Python Programming: Variables

Which variable names are valid?

$my_favorite_animal

my best dress

_day_of_the_week

2_day_of_the_week

ROB123

HowAreYou

HowAreYou?

*Sahith

“Color”

Page 31: Python Programming: Variables

String

Page 32: Python Programming: Variables

String is Text

“I love you.”

“My name is Charles”

‘12345678910’

“hello 903, hey, howdy,hmm_$%#@”

Page 33: Python Programming: Variables

String = Text

Page 34: Python Programming: Variables

Tying Strings Together

“Hello!” “My name is Leena.”+

Page 35: Python Programming: Variables

“Hello!” “My name is Leena.”+

“Hello!My name is Leena.”