Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Using the Range Function | Loops in Python
Introduction to Python (dev copy)

bookChallenge: Using the Range Function

Uppgift

Swipe to start coding

Using a for loop, print all the numbers from 10 to 20 (inclusive) squared (100, 121, 144, and so on). Make sure your output includes the squares of both the starting number (100) and the ending number (400).

Note

The square operator should only be applied in the print statement, whereas the for loop should just iterate from 10 to 20.

Lösning

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 5. Kapitel 6
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

Suggested prompts:

Sammanfatta detta kapitel

Explain code

Explain why doesn't solve task

close

Awesome!

Completion rate improved to 1.64

bookChallenge: Using the Range Function

Svep för att visa menyn

Uppgift

Swipe to start coding

Using a for loop, print all the numbers from 10 to 20 (inclusive) squared (100, 121, 144, and so on). Make sure your output includes the squares of both the starting number (100) and the ending number (400).

Note

The square operator should only be applied in the print statement, whereas the for loop should just iterate from 10 to 20.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

close

Awesome!

Completion rate improved to 1.64
Avsnitt 5. Kapitel 6
single

single

some-alt