Skip to content

testing git..:) #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@


//testing git.... :)


A beginner tutorial series for everyone whosoever is enthusiatic to begin with Python apps.
This is the first commit in series, and I am beginning with Flask-app tutorial.
4 changes: 4 additions & 0 deletions basic python programmes/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions basic python programmes/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions basic python programmes/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions basic python programmes/.idea/pythonp.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

174 changes: 174 additions & 0 deletions basic python programmes/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions basic python programmes/ascii.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'''this programme converts asccii code to character
and a character into an ascii code'''
print("Choose an option from below : ")
print("1.covert ascii to character.")
print('2.Covert character to ascii')
i = int(input('Enter choice : '))
if i == 1:
print('Enter a number from 1 - 256 ')
num = int(input("NUMBER : "))
print("your character : ", chr(num))
# chr returns a string of one character
elif i == 2:
print('Enter a character ')
char = input("CHARACTER : ")
print("your number : ", ord(char))
# ord returns code for one character
else:
print('Invalid input ')
32 changes: 32 additions & 0 deletions basic python programmes/calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# calculator
num1 = int(input('Enter first number : '))

print('Choose one of the following operators :')
print('1> +\n2> -\n3> *\n4> /\n5> ^ ')

op = input('Operator : ')

num2 = int(input('Enter second number : '))

ans = 1

if op == '+':
ans = num1 + num2

elif op == '-':
ans = num1 - num2

elif op == '*':
ans = num1 * num2

elif op == '/':
ans = num1 / num2

elif op == '^':
ans = num1 ** num2

else:
print('Invalid operator input..exiting')
exit()

print(num1, op, num2, '=', ans)
8 changes: 8 additions & 0 deletions basic python programmes/circlearea.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# programme to find circumference and are of a circle
import math
print("Enter the radius of the circle :")
r = float(input("RADIUS : "))
c = 2 * math.pi * r
ar = math.pi * pow(r, 2)
print("AREA : ", ar)
print("CIRCUMFERENCE : ", c)
7 changes: 7 additions & 0 deletions basic python programmes/firstfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
x=float(input('Enter First Number : '))
y=float(input('Enter Second Number : '))
z=float(input('Enter Third Number : '))

print('The max value is ',max(x,y,z))

input('Press anykey to exit..')
54 changes: 54 additions & 0 deletions basic python programmes/funcalc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# calculator using functions


def add(num1, num2):
ans = num1 + num2
return ans


def sub(num1, num2):
ans = num1 - num2
return ans


def mult(num1, num2):
ans = num1 * num2
return ans


def dev(num1, num2):
ans = num1 / num2
return ans


def pow(num1, num2):
ans = num1 ** num2
return ans


""" end of functions
the so called main"""


rep = 'yes'
while rep == 'yes':
num1 = float(input('Enter number 1 : '))
print('Enter one of the following operator :\n+ - * / ^ ')
op = input('Operator : ')
num2 = float(input('Enter number 2 : '))
if op == '+':
ans = add(num1, num2)
elif op == '-':
ans = sub(num1, num2)
elif op == '*':
ans = mult(num1, num2)
elif op == '/':
ans = dev(num1, num2)
elif op == '^':
ans = pow(num1, num2)
else:
print('Invalid input .....Exiting ')
exit()

print(num1, op, num2, '=', ans)
rep = input('Do you want to countinue(yes/no) ? :')
12 changes: 12 additions & 0 deletions basic python programmes/listsasarray.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# using lists as array
n = int(input('Enter the number of elements of the array : '))
arr = []
print('Enter the elements')
count = 0
for x in range(n):
print('Element', count + 1, ':')
ele = int(input())
count += 1
arr.append(ele)

print('Array = ', arr)
15 changes: 15 additions & 0 deletions basic python programmes/palindrome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# to check if the given number is palindrome or not

print('Enter a number ')
num = int(input('NUMBER : '))
rev = 0
temp = num
while num > 0:
b = num % 10
rev = (rev * 10) + b
num = num // 10

if temp == rev:
print('Palindrome')
else:
print('Not a Palindrome')
7 changes: 7 additions & 0 deletions basic python programmes/prime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# programme to check if a number is prime or not
print('Enter a number to check')
num = int(input('NUMBER : '))
if num % 2 == 0:
print('The number is composite')
else:
print('The number is prime')
5 changes: 5 additions & 0 deletions basic python programmes/secondprog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
x = int(input("Enter number 1 : "))
y = int(input("Enter number 2 : "))
z = int(input("Enter NUmber 3 : "))
print("Max value is : ", max(x, y, z))
input("Enter any key to exit..")
Loading