Subject: Python Lab Programs
Basic ‘turtle’ graphics with specific sized window – Python lab program
This program imports ‘turtle’ modules and uses the functions in it to create a turtle window with specific window size.
Sum of Dictionary items – Simple Python Program
This is to demonstrate how “dictionary” is used in Python. Name:Value – pairs.
Palindrome – Python Lab Program
This is to check whether the given string is a palindrome or not.
Counting number of upper case and lower case characters in a given string – python lab program
This program uses “for” loop to process the string. islower() and isupper() functions are used to check whether the current character of the string is in lower case or in upper case.
Counting number of odd and even numbers in a series – Python Lab Program
This program gets the series of numbers from the user, then saves it to the array. The array is processed using “for” loop to check each element. If the number is even, add +1 to the value of ecount, else add +1 to the value of ocount variables. To check whether the number is even … Read more
Factorial – Python Lab Program
This is a simple program to find the factorial of a given number. This program uses recursive function “factorial(x)”. (Example implementation of a recursive function in python).
Fibonacci Series – Python Lab Program
This is a simple program to print the Fibonacci series up to the number that the user entered.