JSDPracticals 2025
JSDPracticals 2025
1)n = int(input("Enter a number: ")) simple interest earned for a given amount at a
if n % 2 == 0: given rate of interest for a given number of
print(n, "is Even") years.
else:
p = float(input("Enter the Principal amount: "))
print(n, "is Odd")
r = float(input("Enter the rate of interest: "))
2)check a given string is palindrome or not
y = float(input("Enter the time in years: "))
s = input("Enter a string: ") si = (p * r * y) / 100
if s == s[::-1]: print("Simple Interest is", si)
print(s, "is a palindrome")
else: 8)To check a given character is vowel or not.
print(s, "is not a palindrome") char = input("Enter a character: ").lower()
if char in 'aeiou':
3) to print the fibonacci series up to a given limit. print(char, "is a vowel.")
limit = int(input("Enter limit for Fibonacci series: ")) else:
a, b = 0, 1 print(char, "is not a vowel.")
while a <= limit:
print(a) 9)to check a given number is prime or not.
a, b = b, a + b n = int(input("Enter a number: "))
if n < 2:
4) find the biggest of three numbers. print(n, "is not a prime number.")
a = float(input("Enter the first number: ")) else:
b = float(input("Enter the second number: ")) for i in range(2, n):
c = float(input("Enter the third number: "))
if n % i == 0:
if a >= b and a >= c:
print(a, "is largest")
print(n, "is not a prime number.")
elif b >= a and b >= c: break
print(b, "is largest") else:
else: print(n, "is a prime number.")
print(c, "is largest")