Create a program that asks the user to guess the color.
Create a mini quiz game program that asks the user three question.The starting score is 10 points.If the answer is incorrect,1poing is deducted from the score
Write the python program using only the import CSV to display the following:
https://drive.google.com/file/d/1OnN0RCvpVJ3A4x02DAOxWNSxJwJmJfm9/view?usp=sharing
NOTE:
DON'T USE ANY DIFFERENT MODULE, JUST IMPORT CSV
by CodeChum Admin
I'm quite into games now, so how about we play In or Out! When a given number is even, the team scores so we shall print "In", but if it's not an even number, then we print "Out". Simple, right?
Now let's get this game started.
How do I construct a loop for my input statements? Input question is, "What type of coffee would you like today?" If user selects a coffee, they pass, but if they fail, they must retry.
order = input("\n" + first_name.capitalize() + "," " " + "What type of Coffee would you like today?\n\n" +
"\n".join(["Expresso", "Latte", "Cappuccino", "Mocha", "Frappuccino"]) + "\n\n")
order = order.replace("and a", "")
order = order.replace("and", "")
order = order.replace(",", "")
order = order.lower().split()
union = " and a " if len(order) > 1 else ""
plural = "" if len(order) > 1 else ""
order = input("\nYou have selected a" + " " + ", ".join(order[:-1]).title() + union + plural + order[-1].title()
+ "!" + " " + "\n\nIs this correct?\n\n")A hospital wants to store a record regarding its patients. The information to store include
Create a class called Patient to store the above information. Date of Birth and Disease of a patient should be private data attributes. Create public methods which take all above information as input from user and then display / output all the information.
Suppose you went to a coffee shop and you want to drink some coffee. You
decided to drink n cup of coffee, where n is an integer value greater than
0. Now you have to pay m taka for the first cup of coffee, 2m taka for the
second cup, 3m takas for the third cup, and so on. In other words, you have
to pay i*m taka for the i-th cup of coffee.
Now you have k taka in your pocket. How many takas do you need to borrow
from your friend to buy n cup of coffee?
The first input in the sample input contains the cost of the first cup of
coffee which can be denoted as m. The second input is the number of coffees
you want to drink, n. The third input is k, the initial amount of taka you
have. You have to calculate how much money you have to borrow from your
friend. If you have more or equal amount of money that is needed than print
0.
Create a Python script which will accept a positive integer and will determine the input number if PERFECT, ABUNDANT, DEFICIENT.
PERFECT - if the sum of the divisors of the number except the number itself is equal to the number.
E.g. 6= 1, 2, 3, 6 1+2+3=6
ABUNDANT - if the sum of the divisors of the number except the number itself is greater than the number.
E.g. 12= 1, 2, 3, 4, 6, 12 1+2+3+4+6 = 16
DEFICIENT- if the sum of the divisors of the number except the number itself is less than the number.
E.g. 10= 1, 2, 5, 10 1+2+5=8
Sample Output:
Input a Positive Integer : 20
20 is ABUNDANT!
Please help me, thank you.
CS curriculum consists n courses, all mandatory. prerequisite graph G node each course, edge course v course w if and only if v prerequisite w. directly graph representation, computes minimum number semesters necessary complete curriculum student can take number courses one semester. running time your algorithm should linear. Input Format: input text file which describes prerequisite graph G. prerequisite graph G DAG. first line file specifies n & m, next m lines specify m edges graph, one line per edge. edge described end points. number vertices n, assume vertices graph numbered (0,1,..n-1). Output Format: Print minimum number of semesters required complete curriculum, given prerequisite graph, minimum number semesters will fixed number, there may be more one way taking courses each semesters. Sample Input ( graph shown right): 9 8 0 3 1 3 2 4 3 5 4 5 5 6 6 7 5 8 Sample Output Minimum number semesters: 5 Sem 1: 0, 1, 2 Sem 2: 3, 4 Sem 3: 5 Sem 4: 6, 8 Sem 5: 7
Given a directed graph, write a program to print all the strongly connected components of the graph. The runtime of your algorithm should be linear. Input Format: The input is a text file which describes an directed graph. The first line of the file specifies n & m, the number of vertices and number of edges in the graph respectively. The next m lines specify the m edges of the graph, one line per edge. An edge is described by its end points. If the number of vertices is n, assume that the vertices of the graph are numbered (0,1,..n-1). Output Format: Print the list of vertices in each strongly connected component, one line per component. (The order in which the SCCs are printed, and the relative order of the vertices within a given SCC does not matter.) Sample Input (for the graph shown on the right): 11 15 0 1 1 2 2 0 1 3 3 5 5 4 4 3 5 7 7 6 6 7 5 8 7 8 8 9 9 10 10 8 Sample Output : SCC 1: 8, 9, 10 SCC 2: 6, 7 SCC 3: 3, 4, 5 SCC 4: 0, 1, 2