0% found this document useful (0 votes)
8 views1 page

Python Variable Types and Operations

The document provides notes on Python data types including integers, floats, and strings, along with type conversion examples. It explains operators such as modulo, floor division, and conditional statements. Additionally, it covers input functions and Boolean expressions for decision-making in code.

Uploaded by

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

Python Variable Types and Operations

The document provides notes on Python data types including integers, floats, and strings, along with type conversion examples. It explains operators such as modulo, floor division, and conditional statements. Additionally, it covers input functions and Boolean expressions for decision-making in code.

Uploaded by

yousefkakar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Python Code Notes 2

Integer = 1,-11,300000

Float=0.3,-8.3,1.22

String=”5”, “-20.2331”, “beep”

type(variable) tells you what type of variable it is. Aka type (‘hello”) gives
class ‘str’

type conversion, int(2.3) gives 2. int(“109.3”) gives an error. Float(“109.3”0


gives 109.3. str(2+3) gives ‘5’

\n = newline

\t = horizontal spacing

=! Not equal

+=

a//b = 2 a=5 b=12

x= x+a  x+=a

% is mod, remainder after dividing left by right, also means a smaller


number divided by a larger number is the same initial number.

** square

// takes what isn’t the remainder after division 15/10=1

Name= input(“Enter your name: “)

Conditionals take a True or False path, are Boolean Expressions

And, both have to be true

Or, either one have to be true

You might also like