Basic Python Vocabulary
Live list of python vocabulary along with basic syntax and its outputs
Vocab List
-
print: used to print a message on the screen. The message can be a string, integer, list, and more ex: print(“Hello!”) outpyt: Hello!
-
input: used to take an input from the user. Input taken from the user will be converted into a string ex: input(“Enter value: “) Enter value: 100 ‘100’
-
.append: used to add elements to the end of a list ex: fruits_list = [‘apple’, ‘banana’, ‘plum’] fruits_list.append(‘peach’) print(fruits_list) [‘apple’, ‘banana’, ‘plum’, ‘peach’]
-
if statement: evaluates whether a condition is true or false. runs code based on that. ex: if 5 > 2: print(“yellow”) Since 5 > 2 = true, ‘yellow’ will be printed