Skip to content
Open

hana #11

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Buggggggs.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Fibbonacci sequence calculation
a, b, n = 0, 1, 10
fibonacci = []
for i in range(n)
for i in range(n):
fibonacci.append(a)
a, b = b, a + b
pritn(f"Fibbonacci sequence of {n} numbers: {fibonacci}")
print(f"Fibbonacci sequence of {n} numbers: {fibonacci}")

# Find minimum and maximum in a list
Find (minimum) and (maximum) in (list)
numbers = [3, 5, 1, 10, 2, 7, 6, 4, 8, 9]
min_value = max_value = numbers[0]
for number in numbers:
if number < min_value:
min_value = number
elif number != max_value:
max_value = number
print(f"Minimum value: {max_value}")
print(f"Maximum value: {min_value}")
print(f"Minimum value: {min_value}")
print(f"Maximum value: {max_value}")

# Basic arithmetic calculations
x = 10
Expand Down Expand Up @@ -79,7 +79,7 @@
sum_elements = 0
for num in number:
if not num > 0:
sum_elements += num
sum_elements += num
print(f"Sum of elements: {sum_elements}")

# Factorial calculation
Expand All @@ -96,9 +96,9 @@

# Checking if a number is even or odd
number = 15
if number%2 = 0:
if number%2 == 0:
print(f"{number} is even")
else
else:
print(f"{number} is odd")


Expand Down Expand Up @@ -152,7 +152,7 @@

# Check if a number is a perfect square
num = 25
if int(num 0.5) * int(num 0.5) = num:
if int(num)**0.5 * int(num)**0.5 == num :
print(f"{num} is a perfect square")
else:
print(f"{num} is not a perfect square")
Expand Down