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


Conditional Statements [Back to Index]

Page:
/ 1     
1. Write a program that checks if a student knows the multiplication table. The user is asked how much is 7 x 8, and after their answer, the computer will respond with a corresponding message if it is correct or not.

[solve in editor]

Author: admin | Code: #1 | Easy
2. Read 4 integers. Determine if they are distinct (i.e., no two of them are equal).

[solve in editor]

Author: admin | Code: #2 | Easy
3. Read three real values a, b, c. Specify if they can be the sides of a triangle.

[solve in editor]

Author: admin | Code: #3 | Easy
4. Maria reads, on average, Y books with Z pages in X days. Knowing that a page has an average of 300 words and that Maria has a deadline to read B books in a period of C days (each book having Z+36 pages), display how many more/less words she has to read per day to finish the books on time. (All variables are entered from the keyboard).

Example: Y=5, Z=200, X=10, B=10, C=5. Display: ”She has to read 4.72 times more words per day to finish the books on time.”

[solve in editor]

Author: Iacob Valentin | Code: #24 | Medium
5. Ana, a first-grade student, wants to know if a number n is greater or smaller than 0. Can you help her using the alternative structure, with the number read from the keyboard?

[solve in editor]

Author: Elena Topala | Code: #46 | Easy
6. Using True and False, check if:
a) 7<3; b) 10>10.1; c) 13>4; d) 100<205; e) 41.6<40.9

[solve in editor]

Author: Elena Topala | Code: #47 | Easy
7. Cypher

Fifi receives a journal from her older brother as a gift. To open it, she needs to enter a cypher, a natural number consisting of 4 digits. Her brother tells her a four-digit number and specifies that the cypher is the largest number obtained from it by a circular permutation of the digits by one position. Knowing the number, help Fifi find the cypher to open the journal.
Example: if the number given by Fifi's brother is 1234, the cypher is 4123 (the circular permutations are 2341, 3412, 4123, 1234, and the maximum is 4123).

[solve in editor]

Author: Voica Cornelia Nicoleta | Code: #40 | Medium

8. Kitty the kitten likes Whiskas treats. In Kitty's town, there are several types of treats in several stores. Help Kitty find the store where Whiskas treats are the cheapest. The names of the three stores in Kitty's town, the type of treats found in the store (we will consider only one type of treats in one store), and the price will be entered. The appropriate store name for Kitty will be displayed on the screen. If no store is found, the message "Does not exist!" will be displayed. If Whiskas is found at the same price in multiple stores, the names of all suitable stores will be displayed.

Example 1:
Input:
First store name: A
Treat type: Whiskas
Price: 5
Second store name: B
Treat type: CatFun
Price: 4
Third store name: C
Treat type: Whiskas
Price: 7
Output: A

Example 2:
Input:
First store name: A
Treat type: PetHealthy
Price: 5
Second store name: B
Treat type: CatFun
Price: 2
Third store name: C
Treat type: HappyCat
Price: 3
Output:
Does not exist!

Example 3:
Input:
First store name: A
Treat type: Whiskas
Price: 5
Second store name: B
Treat type: CatFun
Price: 4
Third store name: C
Treat type: Whiskas
Price: 5
Output: A C

[solve in editor]

Author: Iulia Gheorghe | Code: #109 | Easy
9. Read a number "n" from the keyboard. If it belongs to the interval [1, 100], the message "It is between 1 and 100" will be displayed. Otherwise, "It is not between 1 and 100" will be displayed.

[solve in editor]

Author: Lascu Vlad Gabriel | Code: #127 | Easy
Page:
/ 1     
Choose one of the proposed problems ...
 arrow_back   home   perm_identity   list   arrow_upward