Question: Take the code below to apply all these steps by making one code: 1 - Create a Python script for managing a server. 2 -

Take the code below to apply all these steps by making one code:
1-Create a Python script for managing a server.
2-Create a Python module to consume data from a public API and reformat the data to present as a web page.
3-Create a Python module for complex queries to a SQL or NoSQL database.
4-Create a Python module to search log files for selected content and to generate a report on what is discovered.
Here is the code:
# set the turn number to 1
turn_number =1
# let the user enter the values
die_roll = int(input("Enter a die roll number from 2 to 12: "))
# die roll is a number from 2 to 12
if turn_number ==1:
if die_roll <2 or die_roll >12:
print("Invalid input, try valid input please!!")
if die_roll ==2 or die_roll ==3 or die_roll ==12:
print("player loses")
elif die_roll ==7 or die_roll ==11:
print("player wins")
elif die_roll <=4 or die_roll <=10 :
turn_number+=1
print("continues to turn please")
else:
point_number = die_roll
turn_number+=1
print( "The turn number is "+ str(turn_number)+" and the die roll is "+ str(die_roll))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!