0% found this document useful (0 votes)
3 views1 page

02 Python Coding

This document serves as a beginner-friendly reference for Python coding, covering essential concepts such as input handling, lists, dictionaries, functions, and exception handling. It includes example code demonstrating user input, list operations, and function creation. Key features include using 'input()' for user input, lists for ordered collections, and 'def' for defining functions.

Uploaded by

micasahomes24
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

02 Python Coding

This document serves as a beginner-friendly reference for Python coding, covering essential concepts such as input handling, lists, dictionaries, functions, and exception handling. It includes example code demonstrating user input, list operations, and function creation. Key features include using 'input()' for user input, lists for ordered collections, and 'def' for defining functions.

Uploaded by

micasahomes24
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Coding Notes

Beginner-friendly coding reference

Input
input() reads text entered by a user.

Lists
Lists store multiple values in an ordered collection.

Dictionaries
Dictionaries store key-value pairs.

Functions
Use def to create reusable functions.

Exceptions
try/except can handle expected runtime errors.

Example Code
name = input("Enter your name: ")

numbers = [10, 20, 30]


total = sum(numbers)

def greet(user):
return f"Hello, {user}!"

print(greet(name))
print("Total:", total)

You might also like