1 of 23

ACM PYTHON CRASH COURSE

BASIC SYNTAX, WRITING SIMPLE PROGRAMS, AND HAND—ON CODING CHALLENGES

2 of 23

WHO AM I?

Senior at Regent, B.S. in Computer Science

Event Organizer for ACM

Live in Wilmington, NC

Interned for two software development startups

Started coding in 8th grade

Enjoy piano and apologetics

3 of 23

WHY PYTHON?

Simple Syntax

Versatile

Huge Community

Industry Use Cases

4 of 23

WHAT WE’LL COVER

Basic Python Syntax

Writing Simple Programs

Hands-on Coding challenge

5 of 23

HELLO, WORLD!

>>> PRINT(“HELLO, WORLD!”)

6 of 23

VARIABLES AND DATA TYPES

name = "Alice" # String

age = 20 # Integer

height = 5.8 # Float

is_student = True # Boolean

7 of 23

BASIC OPERATIONS: ARITHMETIC

+ or -�Addition or Subtraction

*�Multiplication

/�Division

//�Floor Division

**�Exponentiation

%�Modulus

8 of 23

BASIC OPERATIONS: STRINGS

+ - Concentration

* - Repetition

len()- Length

9 of 23

USER INPUT

  • input()
  • Prompt user with instructions
  • Reads everything as a string
  • int() and float()
  • Demo: Prompt the user for their name & age.

10 of 23

ARRAYS/LISTS

  • Lists
  • Accessing list elements
  • Looping through strings and lists
  • Strings functioning as arrays
  • String slicing

11 of 23

CONTROL FLOW (IF/ELSE)

Decision-making in Python – if, elif, and else

Boolean expressions

Elif

Else

Comparison operators: ==, !=, >, <, >=, <=

12 of 23

LOOPS (FOR/WHILE)

  • Loops repeat a predefined set of actions
  • For loops iterate over sequences
  • While loops run until a condition is true/false
  • Loop control statements
  • Infinite loops & termination

13 of 23

FUNCTIONS

  • What are functions?
    • Blocks of reusable code that perform a specific task
    • Built-in and custom
  • Function parameters and return values
  • Why use functions?

14 of 23

ANY QUESTIONS?

15 of 23

HANDS-ON CODING CHALLENGE

16 of 23

CODING CHALLENGE INSTRUCTIONS

    • Asks for the user’s name and age
    • Calculates how many years until they turn 100
    • Prints a message like: “Alice, you will turn 100 in the year 2085!”
    • BONUS: Use at least 1 function

Beginner Challenge: 100-Year Calculator

    • Prints numbers from 1 to 50
    • For multiples of 3, print "Fizz" instead of the number
    • For multiples of 5, print "Buzz" instead of the number
    • For numbers that are multiples of both, print "FizzBuzz”
    • BONUS: Modify it to take custom numbers from the user

Advanced Challenge: FizzBuzz+ Custom Counter

17 of 23

BEGINNER CHALLENGE EXAMPLE ANSWER

def calculate_year(age):

return 2025 + (100 – age)

name = input("Enter your name: ")

age = int(input("Enter your age: "))

year = calculate_year(age)

print(f"{name}, you will turn 100 in the year {year}!")

18 of 23

ADVANCED CHALLENGE EXAMPLE ANSWER

def fizzbuzz(n):

for i in range(1, n + 1):

if i % 3 == 0 and i % 5 == 0:

print("FizzBuzz")

elif i % 3 == 0:

print("Fizz")

elif i % 5 == 0:

print("Buzz")

else:

print(i)

num = int(input("Enter the range limit: "))

fizzbuzz(num)

19 of 23

COMMON PITFALLS & DEBUGGING

Indentation errors

Type mismatches

Debugging

20 of 23

LIBRARIES, MODULES, AND PIP

Libraries and modules

The import statement

Common built-in modules

Installing external libraries with pip

Where to find libraries?

21 of 23

WHERE TO GO NEXT?

ONLINE COURSES:�W3SCHOOLS�REAL PYTHON�LEARNPYTHON.ORG

REGENT COURSE:�ISYS214

PRACTICE SITES:�LEETCODE�HACKERRANK�ADVENT OF CODE

PRACTICE/PERSONAL PROJECTS

22 of 23

QUESTIONS, COMMENTS, CONCERNS, ANYTHING ELSE?

23 of 23

THANK YOU FOR ATTENDING!

  • Follow Regent University’s ACM Chapter on Instagram: regent_acm
  • Email us with any questions about the chapter: regentacm@mail.regent.edu
  • Download this powerpoint or see these links: linktr.ee/regentacm or scan QR code: