top of page
  • Subham Das

n=int(input("Enter Number :"))


#Pattern 12 print('(12)') for i in range (1,n+1) : for j in range (1,n-i+1) : print(end = " ") for j in range (i,0,-1) : print("*", end = "") for j in range (i,1,-1) : print("*", end = "") print() for i in range (n+1,1,-1) : for j in range (0,n+1-i) : print(end = " ") for j in range (1,i) : print('*', end="") for j in range (i,2,-1) : print('*',end = "") print() print()


14 views0 comments
  • Subham Das

Updated: Mar 23, 2019

Python is a high level programming language which is based on Interpreter with object oriented feature. In the year 1990-91 the language was first published by Guido van Rossum, developed at the National Research Institute of Mathematics & Computer Science(Centrum Wiskunde Informitca), Netherlands. It is free with better readability and vast set of library function. It can easily synchronize with C and Java and it is comparatively smaller programming language.


CPython is version that can easily synchronize with C library. Jython also known as JPython that can easily synchronize with Java. Iron Python This version of python works on net platform. Stackless Python supports threading. Py Py also know as 'Python in Python'. The software is written using Python. Django is python based free and open-source web framework which follows the model-view-architect pattern. Python can also be written in IDLE or it is better to start writing program in IDLE.




You can download Python IDLE from this link: https://www.python.org/

Or you may Editor also: https://www.jetbrains.com/pycharm/



How Python Interpreter Works?




From different editor or IDLE the Python Code is written then it is send to Interpreter and there Byte code is generated after the execution of the code and it ask for any type of inputs if required. After taking input it run the code gives output to their respective editors. The whole process faster than other programming language which based on Compiler.









154 views0 comments
  • Subham Das

In this searching method the element or record is sequentially compared with the list of elements. If the element match with the elements present in any position then the search is successful and the position or index value is returned. Otherwise the search is unsuccessful.


The basic algorithm above makes two comparisons per iteration: one to check if 'list[i]' equals 'serachfor', and the other to check if 'i' still points to a valid index of the list. , the second comparison can be eliminated until the end of the search, making the algorithm faster. The search will reach the sentinel if the target is not contained within the list .

# Program for Linear Search.

# You can take list from user or assign a list.


list = [10,50,30,70,80,60,20,90,40]

# Take input from user of the searching element.


searchfor = eval(input("Enter the element for search :"))

flag = 0

l = len(list)

flag = 0

for i in range(0,l):

if searchfor == list[i] :

flag = 1

# Here position variable will help us to tell the the position of the element in the list.

position = i+1

# Here break statement help to jump out of loop it the condition satisfies.

break

else :

flag = 0

if flag == 1 :

print("The number is in list in position:",position)

else :

print("The number is not in the list")





78 views0 comments
logo12.PNG
bottom of page