Back

Sanskar

Keen Learner and Exp... • 1d

Day 3 of learning python as a beginner. Topic: Loops Loops are of two types: for loop and while loop. For loop is used when: 1. you know how many times you have to repeat, in my case I know I have to repeat it 10 times to get a full multiplication table of a number. 2. It is a loop over a sequence like a range or list. ex- for i in range(1, 11): 3. It is mostly automatic. While loop is used when: 1. You don’t know how many times to loop. Therefore it loops until a condition becomes false. ex- while(table<11): 2. It is manual, you may need an input to keep it running (in my case the number). In my project of multiplication table generator I used while loop as I wanted to take input from user more than once. Here's the code and result.

Reply
2

More like this

Recommendations from Medial

sai akhilesh

Student @Geethanjali... • 11m

🚀 Dive into the world of JavaScript Loops with our comprehensive tutorial! Whether you're just starting out or looking to brush up on your skills, this video is perfect for you. 🔍 What's Inside? ➡ For Loops: Learn how to efficiently repeat action

See More
Reply
2

Sanskar

Keen Learner and Exp... • 2h

Day 4 of learning python as a beginner. Topic: printing * pattern using while and for loop. I took the famous challenge of printing a * (star) pattern my goal was to print a triangle and diamond shape pattern. first I used int(input()) function to

See More
Reply
1
Image Description
Image Description

Sadashiva

No competition • 9m

Have you used tripadvisor? How many times have you used it?

4 Replies
1
8
Image Description
Image Description

Chamarti Sreekar

Passionate about Pos... • 2m

Nikita Bier costs $10k for a hour long advisory session - here’s a free ChatGPT prompt for assessing the virality of your app instead: Analyze my app’s current UX, UI, and social architecture through the lens of engineered virality, meme-driven dis

See More
7 Replies
46
34

Aastha

📉 • 3m

Been thinking a lot about how startups die. 
It's rarely the idea.
It’s usually the speed. Or lack of it. Or could be something you may talk about. Came across this old military concept- the OODA Loop - and it’s amazing. Observe -Orient -Decide -Ac

See More
Reply
4
17
Image Description

Only Buziness

Business enthusiasti... • 1m

“Hooked on Repeat: How Habit Loops Build Loyal Customers Without Them Knowing” Habit loops are built on three parts: cue, routine, reward. Once this cycle repeats, a habit is formed—often subconsciously. Businesses engineer these loops to drive cust

See More
4 Replies
3

Dileep Kadiveti

IoT Student with a C... • 1y

[This post has been deleted by the creator]

Reply
5
Image Description
Image Description

Mridul Das

Introvert! • 3m

Ever feel like you're stuck on repeat, making the same mistakes and getting nowhere? Welcome to a quick, no-fluff guide that lays it all out: The Accountability Loop vs. the Doom Loop. One leads to growth, the other keeps you spinning your wheels.

See More
7 Replies
18
37
Image Description

Nirav Patel

Hey I am on Medial • 3m

The Real Founder Job Description : Sell before it exists Build while broke Fail publicly Get back up Repeat Are you passionate enough?

1 Reply
11
Image Description
Image Description

Parth Joshi

Hey I am on Medial • 6m

I have a new innovative idea about cold spray which were used during summer times

4 Replies
3

Download the medial app to read full posts, comements and news.