Python Tutorial #8: FOR Loop | Iterating Collections | BREAK Keyword | Tagalog | Filipino

preview_player
Показать описание
Today we are going to learn about FOR Loop in the Python Language, Iterating Collections and the BREAK Keyword.

Python Tutorial #8: FOR Loop | Iterating Collections | BREAK Keyword | Tagalog | Filipino

Language: Python
Series: Python Tutorial Tagalog

Timestamps
00:00 - Intro
00:12 - Tutorial Flow
00:50 - Indentation
01:21 - For Loop (Explanation)
02:10 - For Loop in Collections (Explanation)
03:17 - For Loop in Collections (Implementation)
04:41 - Else in For Loop (Explanation)
05:38 - Else in For Loop (Implementation)
06:11 - Break in For Loop (Explanation)
06:27 - Break in For Loop (Implementation)
07:17 - Conditions in For Loop (Explanation)
07:39 - Conditions in For Loop (Implementation)
12:49 - Range in For Loop (Explanation)
13:29 - Range in For Loop (Implementation)
14:34 - Account Authentication Simulation Challenge (Explanation)
16:19 - Account Authentication Simulation Challenge (Solution)

2nd Channel

Facebook Page

Join SDPT Exclusive Members
Рекомендации по теме
Комментарии
Автор

you are an example of a true teacher. Thanks sir.

lancecruz
Автор

Your explanations is unique because you can explained slowly and very understable.I always watching your YouTube channel while im eating it easier to understand and A lot of knowledged that i can gained thank you sir❤

noelpenafiel
Автор

You deserve all the subs and views! Keep it up!

arctyn
Автор

Your content is a blessing. Keep up the good work po!

MrSoftDiamond
Автор

❤super legit thank you! Keep on making this kind of video

markdelossantos
Автор

Tuloy mo lang po sir, leaking tulong mo saaim😇

collegeStudent
Автор

My code in 12:00

numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
odd = []
even = []
for iterations in numbers:
if iterations % 2 == 0:
even.append(iterations)
elif iterations % 2 == 1:
odd.append(iterations)
print (f'Even numbers on list: {even}')
print (f'Odd numbers on list: {odd}')

hkdxutr
Автор

hehe Thank you nung ni try ko ang haba sakn dame ko natututunan sau sir


ito po aken kaso haba

Username = ["Billu", "Kawen", "Kim"]
Password = [123, 3231, 313]


clientUse = input("Enter Username: ")
clientPass = int(input("Enter Password: "))

for x in range(1):
if Username[0] == clientUse and Password[0] == clientPass:
print("Welcome Adventurers")
break
elif Username[1] == clientUse and Password[1] == clientPass:
print("Welcome Adventurers")
break
elif Username[2] == clientUse and Password[2] == clientPass:
print("Welcome Adventurers")
break
else:
print("No record for you Adventrers")

favarobahamut
Автор

nagawa ko naman po yung condition 1 for loop only pero iba ngalang yung syntax ko pero same mechanic and purpose din nagawa nya din yung main objective na dapat pair yung username at pass at pag hindi account not found lalabas ganto po yung syntax ko

username = ["megumi", "kazuma", "aqua"]
password = ["m123", "k123", "a123"]

for account in username and password:
q1 = input("username: ")
q2 = input("password: ")
if q1 == username[0] and q2 == password[0]:
print("Hello ", username[0], ", ", "Welcome back!!!")
break
elif q1 == username[1] and q2 == password[1]:
print("Hello ", username[1], ", ", "Welcome back!!!")
break
elif q1 == username[2] and q2 == password[2]:
print("Hello ", username[2], ", ", "Welcome back!!!")
break
else:
print("Account not found, pls try again: ")

oks lang din po ba ito ?

punojustinematthew
Автор

More exercises po sana sa mga loops. Shifter po ako at self-study lang😅

Planning_to
Автор

d ako maka fucos bakit babana pa ? hahaha pero legit may natotonan ako thank you po lods

isaiahlacuarin
Автор

salamat lods galing nyu po pero lods sa quiz nyu po sa bandang else na pwede din maglagay ng break sa bandang huli kasi pag nag input ng wala sa list na username at password tatlong Account Not Found ang mag disdisplay sakin lng po palagay salamat po happy new year 2023!

michaelfetalver
Автор

Bakit po yung akin tumutuloy pa din kahit naka tatlong mali na?

Correct = 0
Incorrect = 3

while Incorrect > 0:
QOne = float(input("1 + 1 = "))
if QOne == 2:
Correct = Correct+1
else:
Incorrect = Incorrect - 1
QTwo = float(input("2 + 2 = "))
if QTwo == 4:
Correct = Correct+1
else:
Incorrect = Incorrect - 1
QThree = float(input("3 + 3 = "))
if QThree == 6:
Correct = Correct+1
else:
Incorrect = Incorrect - 1
QFour = float(input("4 + 4 = "))
if QFour == 8:
Correct = Correct+1
else:
Incorrect = Incorrect - 1
QFive = float(input("5 + 5 = "))
if QFive == 10:
Correct = Correct+1
else:
Incorrect = Incorrect - 1
else:
print("You Lose!")


print("Your Score is :" + str(Correct))
print("Lives Remaining: " + str(Incorrect))


Result:

1 + 1 = 3
2 + 2 = 5
3 + 3 = 8
4 + 4 = 9
5 + 5 = 5
You Lose!
Your Score is :0
Lives Remaining: -2

Process finished with exit code 0

kevencondada
Автор

Btw ito ung saken nag dagdag ako, ung kinalabasan kilala ni program si user


#inde(x) 0 1 2 3
String1="Master\n"
usr=["Emerald", "Eman", "Admin1", "Master1"]#[index]
pswd=["Kpop1", "Master", "Admin", "Master"]
ditoType1=input("Username mo: ")
ditoType2=input("Password mo: ")
for x in range(len(usr)):
if ditoType1 == usr[x] and ditoType2 == pswd[x]:
print("\nWelcome "+str(String1)+(usr[x]))
break
else:
print("Maling impormasyon")

putingsombrero
Автор

Hi po, tanong ko lang kung tama tong approach ko sa exercises

username = ["John", "Alenere", "David"]
password = ["abc123", "123abc", "hahatdog"]

for x in username:
questionOne = input("Username: ")
questionTwo = input("Password: ")
if questionOne == "John" and questionTwo == "abc123":
print("Welcome John")
break
elif questionOne == "Alenere" and questionTwo == "123abc":
print("Welcome Alenere")
break
elif questionOne == "David" and questionTwo == "hahatdog":
print("Welcome David!")
break
else:
print("Account Not Found")
break

dre
Автор

# ACCOUNT AUTHENTACATION

usernames = ["John", "Alenere", "David"]
passwords = ["john123", "abc", "abc123"]

currUser = input("USERNAME : ")
currPass = input("PASSWORD : ")

for i in range(len(usernames)):
if currUser == usernames[i] and currPass == passwords[i]:
print("WELCOME ", currUser)
break
else:
print("INVALID")
break

kulugo_
Автор

bro yung sa solution bakit range lng ng username ang kinuha mo? di na need kunin range ng password? pano kung may magka parehas ng password? sample 5 username pero password 3 lang kasi same password yung iba. sana ma sagot.. thank u :D

angelomiguelsanchez
Автор

Bakit po di naka For Loop yun password at only yun username tapos nagra-run parin yun program?

chammerjakeplaza
Автор

Idol sa conditional loop ako bakit ayaw gumaba ng else

johnvelasco
Автор

pwede po ba kayo mag gawa ng tutorial ng pag gawa ng flowchart about po doon sa Acc. Authentication Simulation? hehehhe btw thank you po dito sa tutorial

lyricomanoban
join shbcf.ru