Format
Format
Format
PRACTICALS
OR
INFORMATICS PRACTICES (065)
PRACTICALS
YEAR 2023-24
Name: _______
Roll No: ______
Class & Sec: ____
INDEX
Sr. no Name of the Practical Page No Date Signature
larger/smaller
Practical 1
Input a welcome message and display it
Code:
print("Hello, ",welcome_message)
Result:
Practical 2:
Code:
else:
Result:
Practical 3 :
Code:
a=int(input("Enter a number"));
else:
else:
Result:
Practical 4:
Code: 1
for i in range(1,6):
for j in range(i):
print( )
Result:
Code: 2
for i in range(6,0,-1):
print()
Result:
Code: 3
n=5
for i in range(n):
for j in range(i+1):
Result:
Practical: 5
Code:
#series 1
#series2
#series3
#series4
Result:
1: 2:
3: 4:
Practical: 6
#palindrome number
number=int(input("Enter any number:"))
num=number
num1= number
rev=0
while num>0:
digit=num%10
rev=rev*10+digit
num=int(num/10)
if number==rev:
else:
#perfect number
num1= number
rev=0
sum1 = 0
if(number % i == 0):
sum1 = sum1 + i
if (sum1 == number):
else:
#armstrong number
number=int(input("Enter any number:"))
num=number
num1= number
rev=0
sum = 0
temp = num1
digit = temp % 10
sum += digit ** 3
temp //= 10
if num1 == sum:
else:
1: 2:
3:
Practical: 7
Code:
if num > 1:
break
else:
elif num == 0 or 1:
else:
print()
Result:
Practical: 8
fibonacci series
Code:
#fibonacci series
n = int(input("Number of terms"))
n1, n2 = 0, 1
n3 = n1 + n2
n1 = n2
n2 = n3
print()
Result:
Practical: 9
Code:
i=1
gcd = i
i=i+1
i=1
greater = num1
else:
greater = num2
while(True):
lcm = greater
break
greater += 1
Result:
Practical: 10
Code:
vowel_count=0
consonants_count=0
vowel = set("aeiouAEIOU")
if alphabet in vowel:
vowel_count=vowel_count +1
consonants_count=consonants_count
else:
consonants_count=consonants_count+1
print("Number of Vowels in ",str," is :",vowel_count)
uppercase_count=0
lowercase_count=0
for elem in str:
if elem.isupper():
uppercase_count += 1
elif elem.islower():
lowercase_count += 1
Result:
Practical: 11
Code:
str=input("Enter a string:")
w=""
w = w+element
if (str==w):
else:
str=input("Enter a string:")
w=""
if element.isupper():
w = w+element.lower()
else:
w = w+element.upper()
print(w)
Result:
Practical: 12
Code:
NumList = []
NumList.append(value)
print("The Smallest Element in this List is : ", min(NumList))
Result:
Practical: 13
Code:
#Input a list of numbers and swap elements at the even location with the elements
mylist = []
print("Enter 5 elements for the list: ")
for i in range(5):
value = int(input())
mylist.append(value)
odd_i = []
even_i = []
if i % 2:
even_i.append(mylist[i])
else :
odd_i.append(mylist[i])
Practical: 14
Code:
mylist = []
print("Enter 5 elements for the list: ")
for i in range(5):
value = int(input())
mylist.append(value)
element = int(input())
for i in range(5):
if element == mylist[i]:
Result:
Practical: 15
Code:
#dictionary
result = {}
for i in range(no_of_std):
print(result)
Result: