Show Menu
Cheatography

python cheat sheet Cheat Sheet by

vocabulary

Variable
Holds a value and can be change
strings
number, letter, symbols
float number
decimal number
boolean
true/false
integer number
whole number
length
length of string

Example

#kritanan chanta­waralak
"­"­"I wearing glasse­s"""

x=3
y=x+1
print(­y**2)
print(­(st­r(x­)+s­tr(y)))

Firstname= input(­"what is your name:")
Lastname= input(­" what is your last name:")
print(­"­welcome to computer scienc­e",F­irs­tna­me,­Las­tna­me[0])

x= input(­"­enter the number­:")
x= int(x)
print(­(st­r(F­irs­tna­me,­Las­tna­me)­[x]))

y= input(­"how many times should i print this letter­?:")
y= int(y)
print(­((s­tr(­Fir­stn­ame­)[x­]))*y)
 

symbol

#
single line commiting
"­"­"....."""
multi line commiting
+
add
-
subtract
*
multip­lic­ation
/
division
**
to the power of
%
modulu
!=
not equal to
//
divide and quotient is integer

what you should know

string
"...."
Operators
and , or , not
Compar­¬≠ators
MATH symbol
user input
%s, input
condit­ional
if,Eli­f,Else
 

function

print()
display inform­ation on screen
input()
recieve inform­ation from user
int()
convert a value to an integer
float()
change number decimal number
str()
a list of number, letter and symbol
len()
length of string

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.