0% found this document useful (0 votes)
0 views2 pages

2-May

The document contains Python code snippets for various tasks including displaying multiplication tables, finding the largest number among ten inputs and its position, and a mention of an upcoming task to find the smallest number. It demonstrates the use of nested loops and while loops for these operations. Additionally, it explains the logic behind determining the biggest number and its position in a list of inputs.

Uploaded by

Sandeep sahu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views2 pages

2-May

The document contains Python code snippets for various tasks including displaying multiplication tables, finding the largest number among ten inputs and its position, and a mention of an upcoming task to find the smallest number. It demonstrates the use of nested loops and while loops for these operations. Additionally, it explains the logic behind determining the biggest number and its position in a list of inputs.

Uploaded by

Sandeep sahu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

'''

# WAP to display all table B/W 1 to 10 ( Nested Loop )

i=1
while i <=10 : # i = 1 , 2 , 3 , ----- , 10
j=1
while j <= 10:
print(i*j,end=' ') # table of i
j=j+1
print() # move to the new Line
i=i+1
'''
'''
# WAP to Print Table Of ANy No
no = int(input(" Enter Any No "))
i=1
while i <= 10:
print(no , "*" , i ," = ",no*i)
i=i+1
'''

'''
4*1 = 4
4*2 = 8
4*3 = 12
-------
-------
'''
# 'end' inbult variable of print() method and used to write END line char
# WAP to find out BIGGEST no and its POSITION in 10 nos
# no = 11,120 , 7 , 89 , -45 , -90, 400 , 2 , 45 , -100
no = int (input(' Enter No ')) # 11
big=no # big =11
pos=1 # pos = 1
i=2
while i<=10:
no = int (input(' Enter No ')) # 120 , 7 , 89 , -45 , -90, 400 , 2 , 45 , -100
if no > big :
big = no # big = 120,big=400
pos = i # pos = 2,pos =7
i = i + 1
print(" Biggest No = " , big ) # 400
print(" Position = " , pos ) # 7
'''
by default we consider 1st no as biggest no , then compare biggest no with all
remaining entered no , and check the condition if entered no is greather then
biggest no then assign entered no to biggest no
'''

'''
O/P Biggest No = 400 And Position = 6
'''
# assignment
# WAP to find out SMALLEST no and its POSITION in 10 nos

# from tom will go through "for" loop

You might also like