0% found this document useful (0 votes)
10 views

Lesson 0 - Types, Variables, Input

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lesson 0 - Types, Variables, Input

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Lesson 0

By Kaloyan Totev
data types
Limits of an integer

• No limit in length

• In really long integers there might


be ValueError when converting to
string
string

• To write a string you can use either “ or ‘

• Len()

• “”” triple-quoted strings can span upon


multiple lines “””

• “”” a triple-quoted string is the closest


python has for multiline comment “””
Escape
Sequences
F-String Literals
String
functions
variables
THINK OF A VARIABLE AS IN PYTHON, VARIABLES PYTHON ALSO ALLOWS IN PYTHON, A VARIABLE THIS ASSIGNMENT
A NAME ATTACHED TO A NEED NOT BE DECLARED CHAINED ASSIGNMENT, MAY BE ASSIGNED A CREATES AN INTEGER
PARTICULAR OBJECT. OR DEFINED IN WHICH MAKES IT VALUE OF ONE TYPE AND OBJECT WITH THE VALUE
ADVANCE, AS IS THE POSSIBLE TO ASSIGN THEN LATER RE- 300 AND ASSIGNS THE
CASE IN MANY OTHER THE SAME VALUE TO ASSIGNED A VALUE OF A VARIABLE N TO POINT TO
PROGRAMMING SEVERAL VARIABLES DIFFERENT TYPE THAT OBJECT.
LANGUAGES SIMULTANEOUSLY: A = B
= C = 300
• What happens when it is executed? Python does not create another object. It
simply creates a new symbolic name or reference, m, which points to the same
object that n points to.
•m=n
What happens when
you reassign a variable
to another type of
object ?
n = "foo"
Variable names
PEP 8

• snake Case should be used for functions and variable names.


• Pascal Case should be used for class names. (PEP 8 refers to this as the “CapWords” convention.
Type casting
Type()
Conversion table
Reserved
words
INPUT
Print function

You might also like