Showing posts with label For Loop. Show all posts
Showing posts with label For Loop. Show all posts

Sunday, July 19, 2020

Python Class 176 (Odd/Even Numbers from a range) - Kapil

index1 = int(input("Please enter the starting range number: "))
index2 = int(input("Please enter the ending range number: "))

print("\n")

print("Prime number between {} and {} are:".format(index1, index2))

for num in range(index1,index2):
    if (num > 1):
        isDivisible = False
        for index in range(1, num):
            if (num % index == 0) or (num % 2 == 0):
                print("\n")
                print(num, "- is even number.")
                print("\n")
                isDivisible = True
                print(num,"The number is not prime.")
                break
        if not isDivisible:
            print("\n")
            print(num, "is a prime number.")
            print("\n")


===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Monday, May 11, 2020

Python Class 116 - Kapil Sharma

myFood=['bread','milk','rice']

print(myFood)
for food in myFood:
    print("I want " + food + ".")
====================================

myFriends = ["Puneet", "Himanshu", "Dushyant", "Mohit"]
for mybuddy in myFriends:
    print(myFriends, 'are my friends.')

==================================

K =1
while K < 10:
      print(K)
      K += 1

======================

number = 0
while number <= 9:
    number += 1
    print("Loop count:", number)

======================

from pip._vendor.distlib.compat import raw_input

myName = raw_input("Please enter your name: ")

while myName == "Kapil":
    print("You entered the correct name.")
    break
else:
    print("Wrong Input")
==========================================


https://github.com/bornfreesoul/PythonLessons https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Sunday, May 10, 2020

Python Class 115 - Kapil Sharma

#For Loop Example - 1:
my_Money5 = ["Dollar","Rupee","Ruble"]

for Money in my_Money5:
      print (Money, "Currency")
      
#For Loop Example - 2:
for i in range(1000):
    print ("i= ", i)
    if (i == 999):
        break

#While Loop:
count = 0
while count < 10:
    print("Count is less than ten.", count)
    count+=1

Blockchain: 101 (By - Kapil Sharma)

 https://testing-mines.blogspot.com/2021/10/blockchain-101-by-kapil-sharma.html Blockchain through the following attributes: Distributed:  T...