<jupyter_start><jupyter_text><jupyter_code>name
name="Gaurav"
my_list=[1,2,3,'Gaurav']

#for eachcharacter in 'gaurav'
for i in name:
  print(i)

print()

for eachChar in name:
  print(eachChar)

print()
#we can use direct sequence data or data(sequence) assigned to variable
for j in "Pavan":
  print(j)
print()

#for eachcharacter in 'gaurav'
name="Pavan"
print(name)
for i in name:
  print(i,end='')

my_list=[1,2,3,'Gaurav']
for eachElement in my_list:
  print(eachElement)


for eachElement in my_list:
  print(eachElement,end='')

print()

my_tuple=(4,2,3,'Pavan')
for j in my_tuple:
  print(j)
#range(10) 0-10, total 11 number always starts
for eachNumber in range(11):
  print(eachNumber,end='')

print()

for i in range(5,11):
  print(i,end='')

print()

for i in range(5,12):
  print(i)
print()

2,4,6,8,10
for l in range(1,11,2):
  print(l)
print()

for m in range(1,11,3):
  print(m,end='')
print()
#when iterating over dictionary it will iterate over keys
my_dict1={
    "name":"Gaurav",
    "age":20,
    "marks":56
    }
print("Keys are :",end="")
for eachElement in my_dict1:
  print(eachElement,"",end='')


#find the tottal of student marks
students_marks=[50,98,67,89,69,77]
'''
50 asisin this to some temp variablke
now get new which is 98
50+98
add the result temp value
'''
temp=0
for score in students_marks:
  temp=temp+score
  #temp=0+50 temp=50
  #temp=50+98 temp=148
  #temp=148+67 temp=2 hundred's
  #temp=2hunderes+89 temp
  #...
  #....
print("Gaurav your total score is",temp)
print("your percentage is",temp/6)
print("your percentage is",temp/len(students_marks),"%")

450/6
print(len("hello"))
print(len([50,98,67,89,69,77]))
"""my_list=[1,2,3,'Gaurav']
for eachElement in my_list:
  print(eachElement)"""
'''
mylist1=[[1,2,3], [4,5,6], [8,9,10.7384]]
for eachList in mylist1:
  print(eachList)'''

mylist1=[[1,2,3], [4,5,6], [8,9,10.7384]]
for eachList1 in mylist1:
  print(eachList1)
  for eachValue in eachList1:
    print(eachValue)

#540 table output
for i in range(1,11):
  print("540 * {} = ".format(i),540*i)
'''
*
**
***
****
*****
'''
'''
i=1, range(1)=0
i=2, range(2)=0,1
i=3, range(3)=0,1,2
i=4, range(4)=0,1,2,3
i=5, range(5)=0,1,2,3,4
'''

for i in range(1,6):
  for j in range(i):
    print('*',end="")
  print()<jupyter_output>*
**
***
****
*****<jupyter_text>We are going to see more examples of FOR, FOR and IF combine, usage of PASS, BREAK, CONTINUE<jupyter_code>#1 to 100 print 10, 20 30 40 100
#100 ,90 10 print in reverse
for eachValue in range(10,110,10):
  print(eachValue)

print()
for i in range(100,0,-10):
  print(i)
for eachValue in range(10,110,10):
  if eachValue == 100:
    print(eachValue,"- front benchers")
  elif eachValue >= 80:
    print(eachValue,"- friends of front benchers")
  elif eachValue > 40 and eachValue <80:
    print(eachValue,"- most successful people in life")
  else:
    print(eachValue,"- You need find your passion")


#factorial program
#10 = 1*2*3*4*5*6*7*8*9*10
#4 = 4*3*2*1
#0 and 1 = 1
#-8 = no factorial

#1st loop fa = 1
#output variable =1
#output = 1*1
#output = 1

#2nd loop fa =2
#2*1
#output=2

#3rd loop fa =3 
#3*2
#output =6
[1,2,3,4,5]
["hello",1,3.5,"sttudentt"]
fact_number = int(input("Enter any number:"))
output=1
if fact_number < 0:
  print("there is no factorial for this number")
elif fact_number == 0 or fact_number == 1:
  print("factorial for number {} is always 1".format(fact_number))
else:
  for fa in range(1,fact_number+1):
    output = fa*output
  print("The factorial of number {0} is {1}".format(fact_number,output))


#cube sum
#input as 4
#1**3 + 2 **3 + 3**3 + 4**3 
result=0
cube_number = int(input("enter your number:"))
for num in range(1,cube_number+1):
  result=(num**3)+result
print(result)
for eachChar in "studentts":
  if eachChar == 'd':
    break
  print(eachChar)
for eachChar in "studentts":
  if eachChar == 'd':
    continue
  print(eachChar)
for eachChar in "students":
  if eachChar == 's':
    continue
    print(eachChar)
  elif eachChar == 'd':
    break
    print(eachChar)
  else:
    print(eachChar)

  print("Hello")
#sum of positive number
#[10,20,-8,-7,4,5,-3]
#+ve number 10,20,4,5
#10+20+4+5
output=0
numbers= [-10,10,20,-8,-7,4,5,-3]
for num in numbers:
  if num < 0:
    continue
  output +=num #output = num+output #  a=a+b #a+=b
print("The sum of positive numbers is",output)
  


#sum sequence with even number only, if odd number found exit the program
numbers1= [-10,10,20,-8,-7,4,5,-3]
numbers2= [-10,10,20,-8,4]
output=0
for num in numbers1:
  if num%2!=0:
    print("This sequence has odd number")
    break
  else:
    output += num





my_list=[[1,2,3],[4,5,6],[7,8,9]]
for list in my_list:
  print(list)
  for value in list:
    if value%2==0:
      #continue
      break
    print(value)
#[i for i in range(2,6)]


my_list = [i for i in range(2,6)]
print(my_list)

'''
my_list1=[]
for i in range(2,6):
  my_list1.append(i)
print(my_list1)
'''
my_list = [i*i for i in range(2,6)]
print(my_list)
my_list = [i*i for i in range(2,6) if(i%2 == 0)]
print(my_list)
my_strings = [eachChar for eachChar in "students"]
print(my_strings)

for eachChar1 in "students":
  print(eachChar1)
my_number = [num for num in range(100) if num%2==0 if num%5==0]
print(my_number)

todayClass=True

while todayClass:
  print("condition met")
  todayClass=False

print("hello")
counter=1
while counter<11:
  print("counter is ",counter)
  #counter = counter +1
  counter += 1

print()

for num in range(1,11):
  print("counter is ",num)
counter=1
while counter<11:
  print(counter)
  counter += 1

print()

another_counter=10
while another_counter>0:
  print(another_counter)
  #another_counter = another_counter - 1
  another_counter -= 1

i=0
while i<10:
  if i==4:
    i+=1
    #continue
    break
  print(i)
  i+=1
#10
#1+2+3+...+10

number=int(input("enter some number:"))
counter=0
sum=0

while counter<=number:
  sum=sum+counter
  counter=counter+1

print(sum)

#even or odd
while True:
  value = int(input("Enter some value"))
  if value%2==0:
    print(f"your entered value {value} is even")
  elif value == 89:
    print(f"you have entered value {value} which is an exit number")
    break
  else:
    print(f"you have entered odd number {value}")
for eachChar in "students":
  if eachChar == 's':
    print("hello pass")
    pass
    print("hai after pass")
  elif eachChar == 'z':
    break
  else:
    continue
  print(eachChar)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16656279214708633, 'fraction_numerical': 0.06699906512932377, 'mean_word_length': 4.385067114093959, 'pattern_counts': {'":': 9, '<': 15, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '107745', 'license': 'Apache-2.0', 'n_tokens_mistral': 2745, 'n_tokens_neox': 2580, 'n_words': 711, 'path': 'code/colab-notebooks/loop_book.ipynb', 'repo_name': 'bachinaram/python4all', 'size': '6418'}