Cheatography
https://cheatography.com
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 chantawaralak
"""I wearing glasses"""
x=3
y=x+1
print(y**2)
print((str(x)+str(y)))
Firstname= input("what is your name:")
Lastname= input(" what is your last name:")
print("welcome to computer science",Firstname,Lastname[0])
x= input("enter the number:")
x= int(x)
print((str(Firstname,Lastname)[x]))
y= input("how many times should i print this letter?:")
y= int(y)
print(((str(Firstname)[x]))*y) |
|
|
symbol
# |
single line commiting |
""".....""" |
multi line commiting |
+ |
add |
- |
subtract |
* |
multiplication |
/ |
division |
** |
to the power of |
% |
modulu |
!= |
not equal to |
// |
divide and quotient is integer |
what you should know
string |
"...." |
Operators |
and , or , not |
Comparators |
MATH symbol |
user input |
%s, input |
conditional |
if,Elif,Else |
|
|
function
print() |
display information on screen |
input() |
recieve information 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 |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment