1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tekilochka [14]
2 years ago
8

If anyone knows how to code on python:

Computers and Technology
1 answer:
Allushta [10]2 years ago
5 0

Answer:

def dice_roller():

   # ask for first input

   input1 = int(input("Enter the first roll: "))

   # check if it's valid

   while input1 < 1 or input1 > 6:

       print("Invalid number")

       # ask for new input if the previous was invalid

       input1 = int(input("Enter the first roll: "))

   # ask for second input

   input2 = int(input("Enter the second roll: "))

   # check if it's valid

   while input2 < 1 or input2 > 6:

       print("Invalid number")

       # ask for new input if the previous was invalid

       input2 = int(input("Enter the second roll: "))

   # check of the numbers are the same

   if input1 == input2:

       print("You rolled the same numbers. Try again")

       # if they are the same call this function again to get new numbers

       dice_roller()

   else:

       # print how many spaces to advance

       print("Advance", input1+input2, "spaces")

if __name__ == '__main__':

   dice_roller()

Download txt
You might be interested in
Complete the sentence about a focusing technique.
Butoxors [25]

Answer:

Subjects with a lot of <u>Visuals </u>make focusing easier

Explanation:

Visuals contents make a subject more focusing and interesting for the students. Students can learn that courses easily that have more pictorial content. It is the famous quote that "A picture is better than thousand words to understand".

4 0
4 years ago
Which key removes all data from an active cell with one click? A. Esc B. Delete C. Tab D. F2
bija089 [108]
The answer is B. Delete
6 0
3 years ago
Read 2 more answers
Which of the following is NOT areserved word in Java?intpublicstaticnum
Rama09 [41]

Answer:

num

Explanation:

In java reserved words are also known as keywords, keywords are reserve words for a language that can't be used as an identifier(name of a class, name of a variable, name of an array etc.) int, public static, are reserve words.

In given question num is not a reserved word.

6 0
3 years ago
Nancy would like to configure an automatic response for all emails received while she is out of the office tomorrow, during busi
marishachu [46]

Answer:

I believe the answer is the second one

5 0
4 years ago
Read 2 more answers
Which feature of the Excel window should I use to perform an action
Ne4ueva [31]
It depends on which action. 
5 0
3 years ago
Other questions:
  • For window 7 explain the steps you us to find the available program your software will list ?
    8·1 answer
  • In the software development life cycle, what is the role of participants in the planning phase? The participants’ role in the pl
    6·1 answer
  • Why should you log out when you finish an online session?
    9·1 answer
  • Which of the following menu commands would you select to make a copy of an open file and rename it?
    15·1 answer
  • The user can set their own computer hostname and username. Which stage of the hardware lifecycle does this scenario belong to?
    6·1 answer
  • What is the decimal value of 00001111
    14·1 answer
  • When backing up a database, what is added to the file name?<br> On g metrix
    9·1 answer
  • Prompts what is a row?
    7·1 answer
  • If you forget your privacy password what will you do if the ask this question what is the name of one of your teacher?​
    12·1 answer
  • Please help it’s timed
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!