INTERACTIVE ONLINE COURSE

Python 3

FOR BEGINNERS


"The first Python course that simply amazed me. Very well explained and easy to understand." (Alexandru Cosmin)

"The best Python course in Romania." (Iulian Geană)


ALL REVIEWS
COMUNITY
EXERCISES
Computer Science - Problem Collection in Python


Loops [Back to Index]

Page:
/ 1     
1. Read a natural number. Can it be decomposed into squares?
Example: read 13. Answer: Yes (because 3^2 + 2^2 = 13).

[solve in editor]

Author: admin | Code: #8 | Easy
2. Print all prime numbers between two given natural numbers.

[solve in editor]

Author: admin | Code: #9 | Easy
3. Read the natural numbers x and y. Calculate their product without using the multiplication operator.

[solve in editor]

Author: admin | Code: #12 | Easy
4. Create a guess game (number or word), using the while and if statements.

[solve in editor]

Author: Macovei Andrei | Code: #17 | Easy
5. Hide the vowels! Write a "translator" that replaces vowels with "*" using the while and if loops.

[solve in editor]

Author: Macovei Andrei | Code: #22 | Medium
6. Louie is on vacation, but his father doesn't let him enjoy his free time. Every day, he has to help his father repair the family car, the Rambler they used in the war. One day, Louie can't resist his craving for donuts and sneaks out of his father's garage to go to the donut shop. There, Louie notices that the donuts are glazed with positive natural numbers, and the seller tells him that the donuts with prime numbers are freshly made. Help Louie eat all the fresh donuts by identifying those with prime numbers.

Example: The donuts have the following numbers: 1 2 6 7 13 18 23 27 31 45 47 56 61 66 73. Display: 2 7 13 23 31 47 61 73.

[solve in editor]

Author: Ionescu Maria Magdalena | Code: #26 | Medium
7. Let n be a natural number with at least two digits and at most nine digits. Verify if the number n and the number obtained from n by swapping the first digit with the last digit are both prime numbers.
Example: the number 137 does not meet the conditions because 731 (the number obtained after swapping the digits) is not prime. The number 179 meets the conditions because both 179 and 971 are prime numbers.

[solve in editor]

Author: Voica Cornelia Nicoleta | Code: #41 | Medium
8. The Wizard of Oz wants to help the Tin Man because he doesn't have a heart. Since there is no spell for such a thing, the wizard will try to create a magic potion that must contain 2 Fly Agaric mushrooms, magic powder, wild rose petals, and some crocodile tears. To find out the amount of magic powder to add, the wizard needs to calculate the greatest common divisor of the spots on the two mushrooms (i.e., if gcd=n, then he will need n grams of magic powder) and to find out the number of petals needed, he must calculate the inverse of his age.

Create an algorithm to help the wizard make the potion.

[solve in editor]

Author: Marin Gabriela | Code: #65 | Medium
9. On the wheels of a bicycle, we make a mark at the point of contact with the ground, both on the front wheel and on the rear wheel. What distance does the bicycle have to travel until the two marks are in contact with the ground at the same time, considering that the radius of the front wheel is 19 cm and the radius of the rear wheel is 23 cm?

[solve in editor]

Author: Elena Topala | Code: #97 | Easy
10. In a box, there are 300 balls, numbered starting from one, every three numbers. All balls with even numbers are green. Find out how many green balls there are.

[solve in editor]

Author: Anonymous | Code: #125 | Medium
Page:
/ 1     
Choose one of the proposed problems ...
 arrow_back   home   perm_identity   list   arrow_upward