Python Prac1
Python Prac1
Practical 1
AIM : Develop Programs to understand the control structure of python.
1.Write steps to install python and pycharm IDE for Windows Python
Programming.
Step 1 : To download and install Python visit the official website of Python
http://www.python.org/downloads/ and choose your version.
Step 2 : Once the download is complete, run the exe for install Python. Now click on Install
Now.
Step 2 : Once the download is complete, run the exe for install PyCharm. The setup wizard
should have started. Click “Next”.
Step 3 : On the next screen, Change the installation path if required. Click “Next”.
Step 4 : On the next screen, you can create a desktop shortcut if you want and click on
“Next”.
Step 5 : Choose the start menu folder. Keep selected JetBrains and click on “Install”.
Step 8 : After you click on "Finish," the Following screen will appear.
2.Write a program to implement all arithmetic operators.
def max(a,b,c):
if (a>b and a>c):
return a
elif (c>a and c>b):
return c
else:
return b
print("Largest number is: ",max(num1,num2,num3))
Output:
Enter value of num1: 43
Enter value of num2: 23
Enter value of num3: 65
Largest number is: 65
4. Display all prime numbers within range given by users.
Output:
Enter the lower Number:1
Enter the higher Number:20
prime numbers are: 2
prime numbers are: 3
prime numbers are: 5
prime numbers are: 7
prime numbers are: 11
prime numbers are: 13
prime numbers are: 17
prime numbers are: 19