Sep 14, 2024
print("I like pizza")
.#
to write comments in your code.first_name = "John"
age = 25
height = 5.9
is_student = True
int()
, float()
, str()
, bool()
.input()
function to get user input.if
, elif
, and else
to control program flow.def
keyword.def greet(name):
print(f"Hello, {name}")
try
and except
to handle exceptions.class
keyword.class Dog:
def bark(self):
print("Woof!")
open()
function to open files, with modes ('r'
, 'w'
, 'a'
).