Skip to content
Open
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
32 changes: 18 additions & 14 deletions Buggggggs.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Fibbonacci sequence calculation
a, b, n = 0, 1, 10
# Fibbonacci sequence calculation
n=input()
ab= 0,1
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
numbers = [3, 5, 1, 10, 2, 7, 6, 4, 8, 9]
Expand All @@ -20,11 +21,14 @@
# Basic arithmetic calculations
x = 10
y = 0
sum = x + y
difference = x - y
product = x * y
quotient = x / y

sum=x+y
difference=x-y
product=x*y
quotient=x/y
if y==0:
quotient="error"
else:
quotient=x/y
print(f"Sum: {sum}, Difference: {difference}, Product: {product}, Quotient: {quotient}")

# Prime number check
Expand Down Expand Up @@ -58,7 +62,7 @@
vowels = "aeiou"
vowel_count = 0
for char in string:
if char in vowel:
if char in vowels:
vowel_count += 1
print(f"Number of vowels in the string: {vowel_count}")

Expand All @@ -79,7 +83,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 +100,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 +156,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