# for loops = execute a block of code a fixed number of times. # You can iterate over a range, string, sequence, etc. # ---------------- EXAMPLE 1 ---------------- for x in range(1, 11): print(x) # ---------------- EXAMPLE 2 ---------------- for x in reversed(range(1, 11)): print(x) print("Happy New Year!") # ---------------- EXAMPLE 3 ---------------- for x in range(1, 11, 2): print(x) # ---------------- EXAMPLE 4 ---------------- credit_card = "1234-5678-9012-3456" for x in credit_card: print(x) # ---------------- CONTINUE ---------------- for x in range(1, 21): if x == 13: continue else: print(x) # ---------------- BREAK ---------------- for x in range(1, 21): if x == 13: break else: print(x)
Hey bro, I don’t know if you would have the time to do this. But PLEASE could you do a lua guide from scratch. There are barley any tutorials on YT. And none of them are very good. All I ask is just for around an hour course. But more would be a bonus
I don’t know if this is considered programming but after a very long while of learning python and c++ i recently decided to start developing a roblox game in Lua (which im doing at this very moment while typing this reply)
biggest gigachad because: A) Amazing tutorial B) Said tutorial is absolutely free C) Flat out refuses donations and says no give to a charity D) Has the gigachad picture in his pfp
Welp that made my understanding more clearer, at first I was on a course learning for loops and implementing it Into real situations like a website or software and I was confused but once I saw this it made the understanding of it easier thank you
""" Here I have added while loop in the nested for loops So if the user type a letter or a number, it will ask you to type a symbol instead Yes I have changed the variable from rows and columns to length and breadth respectively to relate this code more to Math """ #Print a rectangle using symbols print("Rectangle using symbols") length = int(input("Enter number of symbols you want horizontally: ")) breadth = int(input("Enter the number of symbols you want vertically: ")) symbol = str(input("Enter the symbol: ")) for x in range(breadth): for y in range(length): while symbol.isalpha() or symbol.isdigit(): # While condition if the user type any letter or number then the loop will run symbol = str(input("Enter the symbol not a letter from alphabet or a number: ")) print(symbol, end="") print()
question:at 4:22 you have written ''else:'' wich i tried not to write it and see what happens.Nothing changed,so why did you write it (i am asking because of curiosity)
hi! can you please tell how to use for i in range (a, b) and write all decimals between a and b please. I don't understand cause a and b can be only integer, how can i write all decimals (that is a float) between a and b? Thank you !
thanks for distracting me from ninjago overture theme that has been stuck in my head for hours. i am a c++ programmer but i want to learn python so i know complicated languages.
Hey question. Im learning how to code with Crunchzilla and I’m trying to get the answer for a specific question which the internet doesn’t answer. In code monster that im using forloop is used too repeat code to make boxes c.fillRect. So they use this code:(i=0; i
One of the best tutorials I've seen. I am learning Godot (whose programming language is extremely similar to Python) and this has cleared up a lot! Will subscribe for more. You explained in a way many dont. What's the function? How can you use the function? What's a practical example? You did all of that, nicely done.
Hey bro I have a doubt . It's from python Gui windows. You told us how to create a new window by clicking a button . My problem is when we created a new window, then How can I get the strings value from Entry boxes in the newly created window?!?! I am stuck in this problem from last 20hrs please help . I can use the get method for Entry boxes in 1st window but after creating 2nd window i am unable to use the get method on the entry boxes of window 2 :(
His videos forces me to think why people even buy paid course. It isn't even like he doesn't incorporate other misc. important stuff aswell. Keep going on Bro!
Why in the world they decided to use "continue" instead of "skip". I hope skip does something that makes more sense, otherwise this is utterly meaningless.
I guess because in practical use or exception handling, you use it when you get an exception. After detecting the exception, the program handles it and *_continues_* without crashing. It's the same keyword in other languages.
duuuuudeee how do i run 2 lines of code in the same for loop lets say i wannna add a number to x 10 times and print it hapy 10 times in the same for loop
@@Arsen_winning_way I ended up using - len(file_paths) - to determine the number, then created a range with len being the max and looped it with a file position command.