Comments (7)
Python Loops and Conditionals Tutorial
Loops
Loops are one of the most fundamental control structures in programming. They allow a block of code to be repeated multiple times. Python has two types of loops: for and while.
For Loop
The for loop is used to iterate over a sequence (list, tuple, dictionary, set, string) or any other iterable object.
Iterating over a list
for i in [1, 2, 3, 4, 5]:
print(i) # Prints numbers from 1 to 5
While Loop
The while loop allows the execution of a group of instructions as long as a condition is met (i.e., as long as the condition evaluates to True).
# Example of using the while loop
i = 1
while i <= 5:
print(i) # Prints numbers from 1 to 5
i += 1
Conditionals
Conditionals allow us to check conditions and make our program behave one way or another, according to the results of these conditions.
If, Elif, Else
In Python, the syntax for conditionals is through the reserved words if, elif (else if), and else.
age = 20
if age < 18:
print("You are underage.")
elif age >= 18 and age < 65:
print("You are an adult.")
else:
print("You are a senior.")
This is a very basic rundown of loops and conditionals in Python. There is much more you can do with them, including nesting loops and conditionals, using break and continue in loops, among other things. However, I hope this gives you a solid foundation upon which you can build.
from flyde.
@xbz-24 Although obviously GPT generated, I appreciate the willingness to help.
This issue refers to control flow with Flyde, of course. If you want to learn more about Flyde and try giving a shot at this, I'd love to guide you through it!
from flyde.
@GabiGrin I already have the extension, look what I get when I do new visual flow :
from flyde.
Awesome! Perhaps this issue #8 can help
Also, you're welcome to discuss this on Discord - https://discord.gg/qeetahUmgU
from flyde.
Weird! what is your setup?
from flyde.
m1 mac :( should I try with linux mint
from flyde.
I'm on a m1 mac too :) works great
the error you're seeing means something pretty basic broke, as the commands failed to register
Can you try looking for an error in the VSCode developer tools and then reloading VSCode and looking for related errors?
from flyde.
Related Issues (20)
- Liscense Clarification Question HOT 1
- 🐛 Bug Report: cannot remove connections HOT 1
- Waiting for data indication on main inputs HOT 1
- Tutorial: hello world + input tutorial
- Changelog & better release process
- Explicit error throwing from a visual node?
- Broken imports after moving files
- CLI Runner HOT 1
- VSCode extension editor's "Test Flow" conflicted with existing tsconfig HOT 1
- Type safety for "loadFlow" function when using the extension
- jura HOT 1
- HTTP GET doesn't seem to work... HOT 4
- no apparent way to drag the graph around vscode HOT 1
- mongoDB connect node fails silently without an object in options HOT 1
- using a namespace in user created nodes incorrect sorting HOT 2
- Missing templates for issues HOT 3
- Missing "getting started" as oss dev (not user) HOT 1
- running web browser graph HOT 1
- Design is cluttered and random
- Macro nodes documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flyde.