+ 2
Please send me a Python code with this output(for loop)
* ** *** **** ***** etc
18 Réponses
+ 3
Please send us your attempt at solving this problem by providing a link to your Code Playground project in this thread so we can help you fix it.
+ 2
Arthur thanks for the advices (sorry ive started programming five days ago and il still a noob)❤️
+ 2
ok cool. good talk guys. :)
+ 1
sily mistake
+ 1
lol
+ 1
Can we do a sort of time out guys? For what it's worth:
https://www.codecademy.com/en/forum_questions/5553df3ad3292f9fd00002f2
If we were to just zoom out a bit, I think we'll find that if latency (to that degree) is a concern, you will want to use a lower level language (like C). Python is great for readability and is very suitable as an introductory programming language. Let's not overwhelm the poor newbie with nuanced information that isn't important yet. Save the advanced discussion topics for the advanced students.
+ 1
Markus Kaleton Thank you Janning⭐ , thats what i am talking about
0
yeah just the indent
0
It works
0
Marse With the for loop its more efficient , ad get less lines
0
Marse and its not "+", its with "*"
0
doesn't really matter what type of loop you use for this, nothing to do with efficiency.
Getting stuck in a for loop prison where you dont know when to use it and when not to, might end up being a problem
star = "*"
while len(star) < 7:
print(star)
star += "*"
0
Markus Kaleton Less lines are faster , simpler and cost less time,more efficient, isnt it?..You made a infinity one, time limit will exceed
0
Arthur I ran both codes on several test runs with 30k stars and both give really similar results. (didn't log these or make average counts since im sitting in a car)
0
Markus Kaleton Ok, similar, know put like 20 of then.Its still not similar, so the one with for is more efficient, in a big code its better to do with for, i am saying to Marse which is better because he will need to know when he will make a big code and he want to make it faster
- 1
i = "*"
while 1 == 1:
print(i)
i=i+"*"
if i == "****************************":
break