Can a machine learn how to classify dog breeds?

With the superpower from Convolutional Neural Networks (CNN), the answer is yes! But the most interesting part is to understand how it works. This post will help yourself familiar with CNN…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Truth n Dare Game with Coding in Python

*All important links attached in the end.

Steps to Follow:

a. Open List category present inside Data Structures category and get the first block out.

b. Open text category & get the first block out. Then attach it with list block.

Attach empty text block (1st block of text category) with the “create list with” block

c. Create a variable with name truths and attach its first block — set truths to — with the list block.

d. Now write some truth questions in the text boxes that you added.

2. Similarly, create a list of dares as well.

3. Now ask for the user’s choice.

a. Open the Input/Output category & get the Take Input Text block out.

Getting “take input” block (3rd block from Input/Output category)

b. Now, create a new variable with name choice & attach the set choice to block with the take input block.

Attach “set choice to” block “take input” block

4. Drag out the if-do block from the Logic category and the 2nd block also from the same category. Connect them as shown.

Getting the 1st & 2nd block out of the Logic category

5. In the first blank, attach the variable with name choice and in the 2nd blank, attach the text block with truth written inside it as shown.

6. Now get the print block out from the input output category & attach it with the — in list list get #— block present in the list category.

7. First, Put this print block inside the do part of the if block. Now, click on list & a dropdown will appear. From that dropdown choose truths list. After that click on the # in the same block & choose random option from the dropdown.

Getting random truth from the list of truths

8. Now, click on the settings button present in the if-do block. Drag the else-if block and attach it under the if block inside the popup only (as shown)

Making an “if-do” block as “if-do-else if-do” block with settings button

9. Click on the settings button again, to close the popup & then complete your code as shown.

Code ready to print random truth or dare based on user’s choice

10. The last step! To check if any other wrong choice is entered by the user, again open the settings popup of if block & now drag the else block towards the right side & attach it under the else-if block. Then add a print statement inside the do part of the else statement.

And you are done!!!! Press the Run Button

& try playing the game!

Add a comment

Related posts:

got it

Semenjak kejadian Jeremy memberi respon sesuai dengan permintaan Kenzy yang dimana diangguki langsung oleh Khail (dan itu tentu saja membuat Jeremy maupun Kenzy sedikit terkejut karena mereka…