forked from spencg2/Personal_Goldstein
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest1
More file actions
43 lines (34 loc) · 959 Bytes
/
Test1
File metadata and controls
43 lines (34 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python3
"""
Simple test script for Spencer Goldstein's webpage
"""
def greet(name):
"""Return a personalized greeting"""
return f"Hello, {name}! Welcome to my webpage."
def calculate_fibonacci(n):
"""Calculate the first n numbers in the Fibonacci sequence"""
if n <= 0:
return []
elif n == 1:
return [0]
fib = [0, 1]
for i in range(2, n):
fib.append(fib[i-1] + fib[i-2])
return fib
def main():
print("=" * 50)
print("Spencer Goldstein's Test Script")
print("=" * 50)
# Greeting
print("\n" + greet("Spencer"))
# Fibonacci example
print("\nFirst 10 Fibonacci numbers:")
fib_numbers = calculate_fibonacci(10)
print(fib_numbers)
# Simple calculation
print("\nQuick math:")
print(f"2 + 2 = {2 + 2}")
print(f"10 * 5 = {10 * 5}")
print("\nScript completed successfully!")
if __name__ == "__main__":
main()