basic cheatvariable : comment : integers/floats = numbers single = #comment strings/text = characters multi = """comment""" boolean = true/false functionint() change number into integer float() change number into decimal input() ask for information from user str() A list of number, letter and symbols |
concatenationconcatenation = joining multiple strings together ex. phrase = "Task" + "is" + "balding" print (phrase) output = TaskisBalding !!!!Note!!! gaps/spaces phrase = "Task " + "is " + "balding" print (phrase) output = Task is Balding string methodupper = capital letter ; upper() ex. print (cat.upper()) lower = small letter ; lower() ex. print (cat.lower()) str = make into string ex. x = 47 y = str(x) dot notation can use only string |
basic math+ addition output : print() - subtraction assigning strings : using "..." * multiplication string placement : 1st letter = 0 / division print multiple variables : using comma ** to the power of length : how many symbols are used ex. len(cat) % modulo blank space counts as a character ex : dog = "small puppy" print (len(dog)) |
Cheatography
https://cheatography.com
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment