Professional Documents
Culture Documents
Kartik Jatwani 1/18/FET/BBT/003
Kartik Jatwani 1/18/FET/BBT/003
1/18/FET/BBT/003
Program 1.
Aim: Demonstrate the installation of Python and its Editor, various package installation Process.
Python can be installed directly from the browser, windows store etc.
As mentioned earlier, there are three ways to install the official Python distribution on Windows:
1. Microsoft Store package: The most straightforward installation method on Windows involves installing from
the Microsoft Store app. This is recommended for beginner Python users looking for an easy-to-set-up
interactive experience.
2. Full Installer: This approach involves downloading Python directly from the Python.org website. This is
recommended for intermediate and advanced developers who need more control during the setup process.
3. Windows Subsystem for Linux (WSL): The WSL allows you to run a Linux environment directly in
Windows. You can learn how to enable the WSL by reading the Windows Subsystem for Linux Installation
Guide for Windows 10.
In this section, we’ll focus on only the first two options, which are the most popular installation methods in a
Windows environment.
If you want to install in the WSL, then you can read the Linux section of this tutorial after you’ve installed the Linux
distribution of your choice.
Note: You can also complete the installation on Windows using alternative distributions, such as Anaconda, but this
tutorial covers only official distributions.
Anaconda is a popular platform for doing scientific computing and data science with Python. To learn how to install
Anaconda on Windows, check out Setting Up Python for Machine Learning on Windows.
The two official Python installers for Windows aren’t identical. The Microsoft Store package has some important
limitations.
The official Python documentation has this to say about the Microsoft Store package:
The key takeaway here is that the Microsoft Store package is “intended mainly for interactive use.” That is, the
Microsoft Store package is designed to be used by students and people learning to use Python for the first time.
In addition to targeting beginning Pythonistas, the Microsoft Store package has limitations that make it ill-suited for a
professional development environment. In particular, it does not have full write access to shared locations such
as TEMP or the registry.
If you’re new to Python and focused primarily on learning the language rather than building professional software,
then you should install from the Microsoft Store package. This offers the shortest and easiest path to getting started
with minimal hassle.
Kartik Jatwani
1/18/FET/BBT/003
On the other hand, if you’re an experienced developer looking to develop professional software in a Windows
environment, then the official Python.org installer is the right choice. Your installation won’t be limited by Microsoft
Store policies, and you can control where the executable is installed and even add Python to PATH if necessary.
You can use pip, Python’s package manager, to install and manage Python packages.
If your Python 2 version is greater than or equal to 2.7.9, no need to worry, you have pip pre-installed!
There are a multitude of Python packages, which you can find on PyPI — the Python Package Index — the official
repository for third-party software for the Python programming language. PyPI is where pip grabs Python packages
from when you use pip to install a new package on your computer.
You can use pip for a variety of other things as well, which you can learn about through a quick search on the web.
Kartik Jatwani
1/18/FET/BBT/003
Program 2.
Aim: Write a program to illustrate the usage of Integer and String Values.
Code:
d=str(y)
Kartik Jatwani
1/18/FET/BBT/003
Program 3.
Aim: Write a program to illustrate the usage of Identifiers, User Input, String Formatting.
Code:
"""
"""
d=str(y)
Kartik Jatwani
1/18/FET/BBT/003
Program 4.
Aim: Write a program to demonstrate the usage of logical operations. (e.g. greatest among three numbers).
Code:
num1=input('Enter 1st number:')
x=int(num1)
y=int(num2)
z=int(num3)
else:
Kartik Jatwani
1/18/FET/BBT/003
Program 5.
Aim: Write a Python program to show the usage of Loop control statements and break, continue and pass
statements.
Code:
x=input(' Enter a number between 1 and 3:')
i=int(x)
while i < 6:
print(i)
i += 1
print(' ')
j=int(y)
while j < 6:
print(j)
if j == 3:
break
j += 1
j=0
print(' ')
k=int(z)
while k < 6:
k += 1
if k == 3:
continue
print(k)
Kartik Jatwani
1/18/FET/BBT/003
Kartik Jatwani
1/18/FET/BBT/003
Program 6.
Aim: Write a Python program to implement lists ( Creating, Accessing, Updating, Indexing).
Code:
# Creating a List
List = []
print("Blank List: ")
print(List)
# Creating a List of numbers
List = [10, 20, 14]
print("\nList of numbers: ")
print(List)
Kartik Jatwani
1/18/FET/BBT/003
Program 7.
Aim: Write a Python program to implement Function ( Factorial of number, finding number is prime or not).
Code:
factorial = 1
if num < 0:
elif num == 0:
else:
factorial = factorial*i
flag = False
if num > 1:
if (num % i) == 0:
flag = True
break
if flag:
else:
Kartik Jatwani
1/18/FET/BBT/003
Program 8.
Code:
max = arr[0]
max = arr[i]
return max
arr = [10,20,5,3,7]
n = len(arr)
Ans = largest(arr,n)
Kartik Jatwani
1/18/FET/BBT/003
Program 9.
Code:
my_str = 'aIbohPhoBiA'
my_str = my_str.casefold()
rev_str = reversed(my_str)
if list(my_str) == list(rev_str):
else:
Kartik Jatwani
1/18/FET/BBT/003
Program 10.
Code:
print(text.split(' '))
print(' '.join(text))
Kartik Jatwani
1/18/FET/BBT/003