Define a function main that will draw a circle with the following parameters when the program is run: X = 50 Y = 75 Radius = 100 import turtle import math def draw_circle(radius, x, y): turtle.up() turtle.goto(x, y + radius) turtle.down() for i in range(120): turtle.forward(2 * math.pi * radius/120.0) turtle.right(3.0) return draw_circle(100, 25, 75)
Q: JS In this challenge, you must verify the equality of two different values given the parameters a…
A: Algorithm - Design a method with two arguments. Now use the below logic to solve the problem.…
Q: We can assign a value to each character in a word based on their position in the alphabet (a = 1, b…
A: Code function balanced(word) { let alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',…
Q: Another question, I suppose to draw a snowflake using this function, but everytime I get to the…
A: Given: Another question, I suppose to draw a snowflake using this function, but everytime I get to…
Q: The use of functions is very useful to carry out tasks. For instance, we might want to define a…
A: To Plot graph for user defined function sinex.
Q: Write a function that takes a DrawingPanel as a parameter and draws the horizontal pyramid shape as…
A: from tkinter import *WIDTH = 300HEIGHT = 200N_RECT = 10class DrawingPanel: def __init__(self,…
Q: Write a function snake that takes an integer n and returns a string containing an ASCII-art snake…
A: #include <iostream> using namespace std;//creating functionstring snake(int n){ //create…
Q: Write a python program that creates two global variables, one to store the number of incorrect…
A: here we write simple sudo code for this : if loop till 5 .
Q: Write a python function create_frequency() that takes a string and finds the frequency of each word…
A: function create_frequency(string)- START SPLIT the string and store in the list name words DECLARE…
Q: A java program where the system should use the following methods: .a) Lagrange interpolation for…
A: Interpolation is a method of finding new data points within the range of a discrete set of known…
Q: write a python prgram (oop) Implement the design of the Groceries and Buyer classes so that the…
A: Everything is mentioned in the comments and screenshots are also provided…
Q: Please answer it in Python Write a function double_consonnant that takes as an argument a word and…
A: The above question is solved in step 2:-
Q: Write a program that automates the table used by a surveyor to transform compass headings in degrees…
A: compass_heading=float(input("Please enter the Compass heading in Degrees from 0 to 360: "))…
Q: Create a function that reads first place, (x, y) and then returns the sum of the number of different…
A: Algorithm - Create a new method with name paths with two argument. Now use the below logic to…
Q: In Python Using the celsius_to_kelvin function as a guide, create a new function, changing the name…
A: PROGRAM STRUCTURE: Write the definition of the function to convert the celsius temperature to its…
Q: Write a python function called substrand() that takes two DNA strands (strings) as parameters and…
A: The find() method finds the first occurrence of the specified value. The find() method returns -1 if…
Q: solve in python Write a function randomNumber which will return a single random integer from 0 to…
A: To generate an alphanumeric password using following functions: randomNumber(): It will return a…
Q: You are tasked with writing a small part of a museum's ticketing system. The museum calculates…
A: logic: admissionRate=20 total=0 for i in arr: if i<15:…
Q: In Python: Write a script that asks the user to choose a mathematical function among the…
A: Code: import matplotlib.pyplot as pltimport numpy as np print('Function, Domain')print("1.Sine plot,…
Q: Write the definition of the function add, which takes two integer parameters and returns the sum of…
A: Introduction: Here we are required to write the definition of the function add, which takes two…
Q: JS In this challenge, you must verify the equality of two different values given the parameters a…
A: Coded using JavaScript.
Q: Write a program to draw this. Assume the innermost square is 20 units per side, and each successive…
A: Problem 2: import turtle n = 5; t = turtle.Turtle() for i in range(n): for c in range(4):…
Q: In Python, actual parameters are passed to functionsa) by value b) by reference c) at random d) by…
A: Let's see the solution
Q: in the real world, it is easy to be fooled by the description of a problem into thinking that you…
A: Python sued to answer this question
Q: You are asked to write a python code that can translate a word from English to French of the…
A: Program Approach: Create a dictionary eng_french with the English words as keys and French words as…
Q: TIC – TAC - TOE game (Understanding Alpha – Beta pruning).
A: given - Write a python program to implement TIC – TAC - TOE game (Understanding Alpha – Beta…
Q: Make a python function is_palindrome that takes a string as an argument that returns True if the…
A: here I mention python program to check string palindrome or not below. is_palindrome(str)
Q: ***python only*** Write a function votes_by_race() which takes a list of dicts as a parameter and…
A: code :-- # demo data votes = [{'for': 'A', 'age': 35, 'race': 'w'}, {'for': 'B', 'age':…
Q: write a function get_intersecting_station(line_one, line_two) where line_one and line_two are the…
A: Required: write a function get_intersecting_station(line_one, line_two) where line_one and…
Q: You will be given a list of tuples where each tuple indicates a point i.e. (x, y) in a 2-dimensional…
A: Here for above question we have two solution and i provided both with screenshot and explaination…
Q: Your first task will be to write a simple movement simulator on a snakes and ladders board. For this…
A: import randomx = "y"while x == "y": no = random.randint(1,6) if no == 1:…
Q: Write a Python program where a non-intrinsic function solves for all the roots of a cubic polynomial…
A: Here, I have to write a python program to the above equation. To find sum and product of a cubic…
Q: Implement a function, countVowels, which takes in a string and counts the number of vowels that are…
A: We have to count both lower and upper case characters as well
Q: We are going to write a program to create a word puzzle. For now, what we need is a function…
A: clear;clc[l, n] = promptletnum;fprintf('We will find words that contain the \n')fprintf('letter'' %c…
Q: Using Python For this assignment, we’re going to build our own song remixing solution. As an…
A: Coded using Python 3.
Q: Implement a function eligible in Python that returns a list of the names of people that are eligible…
A: Required: Implement a function eligible in Python that returns a list of the names of people that…
Q: Can someone help Write a program that finds all the ways in which the mouse can move to the cheese,…
A: Answer:
Q: In the real world, it is easy to be fooled by the description of a problem into thinking that you…
A: def hide_letter(s): # here s[1:] will return all letter of string s #except first…
Q: ***in python only*** use turtle function Define the concentricCircles function such that: It…
A: def turtle_pos(art,posxy,lift): if lift: art.penup() art.setposition(posxy)…
Q: a program that reads (alphabetical) input questions (full question) from the user (e.g: what is the…
A: It is defined as the best way to learn Python is by practicing examples. The page contains examples…
Q: Write a python program that will print the numbers in a square shape matrix according to user…
A: required: python program to print a matrix in form of a spiral as given in the screenshot. all the…
Q: Write the following function that draws a line from point (x1, y1) to (x2, y2) with color (default…
A: Given: Write the following function that draws a line from point (x1, y1) to (x2, y2) with color…
Q: Write a python program with function called show_palindromic_triangle that takes a number as an…
A: Python is one of the most popular language of present time. A function basically a block of…
Q: Can someone help with that in cpp Write a program that finds all the ways in which the mouse can…
A: C++ program to build the recursive function that returns all the ways in which the mouse can move to…
Q: Create a Javascript function that takes a numeral (just digits without separators (e.g. 19093…
A: Here, we have to create a Javascript function that takes a numeral (just digits without separators…
Q: So the programming language for this problem is python. How do I create a function that allows the…
A: In this python program, The user is asked to enter an array of integers. First index of this array…
Q: def mystery_function (nl, n2): if n2 - nl > 0: return n2 -n1 elif n2 - nl < 0: return n1 - n2 else:…
A: - We have to talk about the functionality of the function provided.
Q: Write a program in C language to simulate tossing a “fair” coin. Allow the user to enter the number…
A: Write a program using c language that will take a number of tosses as input and find the number of…
Q: ***python only *** Write a function that takes two parameters, a and b, both are strings taken from…
A: used construct:- while construct if else Rule:= paper vs rock-> paper wins Rock vs…
Q: Write a Python module that gets a block of text from the user and prints some statistics about the…
A: Below is the complete solution with explanation in detail for the given question in Python…
Q: Write a python function which will take 2 arguments. They are: Sentence position Your first task is…
A: The programmimg methodology is given bv: Function check with two arguments like sentence and…
Hi, I've been trying to solve this problem to drawCircle using Python and Mindtap.
Define a function main that will draw a circle with the following parameters when the program is run:
- X = 50
- Y = 75
- Radius = 100
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 5 images
- ***python only*** Write a function that takes a DrawingPanel as a parameter and draws the horizontal pyramid shape as shown in the following figure. There are ten rectangles of increasing sizesfilled with increasing shade of green color (increment of G by 20 while keeping R and B at 0). These rectangles should have the same width, and completely symetric with respect tothe center horizontal line of the window. Each rectangle should have a blue outline. A sample run of the following main() function should result in the following graphics. WIDTH = 300 HEIGHT = 300 ### # Your code here ### def main() : panel =Drawing Panel(WIDTH, HEIGHT) draw_objects(panel) panel.window.mainloop if_name_ == '_main_' :main()In Python: Write a script that asks the user to choose a mathematical function among the trigonometric and logarithmic functions available in the python math module. While asking to select the function, you should list the names and limits of the arguments of the functions on the screen. Then ask the user to enter two numbers as the graph's beginning and end values. Then sketch the grapy of the function within the given range.In Python Using the celsius_to_kelvin function as a guide, create a new function, changing the name to kelvin_to_celsius, and modifying the function accordingly.Sample output with input: 283.15 10.0 C is 283.15 K 283.15 K is 10.0 C def celsius_to_kelvin(value_celsius):value_kelvin = 0.0 value_kelvin = value_celsius + 273.15return value_kelvin ''' Your solution goes here ''' value_c = 10.0print(value_c, 'C is', celsius_to_kelvin(value_c), 'K') value_k = float(input())print(value_k, 'K is', kelvin_to_celsius(value_k), 'C')
- I am trying to understand what it means when a variable or a function is static, but still not sure as to what it is. I understand this theoratically, but not sure as to how to when I should use this and how to apply this even in OOP when using the :: symbol? For example class Box{ static string set_name(string n); }; main.cpp #include "Box.h" #include <iostream> int main(){ cout << Box::set_name("my_name") << endl; }The use of functions is very useful to carry out tasks. For instance, we might want to define a function which, for any input x, is equal to sin(x)/x. First we need to pick a name for this function – let’s try calling it sinex. Now we need to create a procedure called sinex within Python, and here is what goes inside it (in pseudocode format): (a) Set up the sinex function. Evaluate it at x = 0, and at x = π. What values do you expect there? Make a table of its values from -2 to 2 in increments of 0.25. (b) Plot the sinex function over the domain of -10 to 10.***in python only*** use turtle function Define the concentricCircles function such that: It draws a series of concentric circles, where the first parameter specifies the radius of the outermost circle, and the second parameter specifies the number of circles to draw. The third and fourth parameters specify an outer color and an other color, respectively. The outer color is used for the largest (i.e., outermost) circle, and then every other circle out to the edge alternates between that color and the 'other' color. The difference between the radii of subsequent circles is always the same, and this difference is also equal to the radius of the smallest circle. Put another way: the distance between the inside and outside of each ring is the same. Define concentricCircles with 4 parameters Use def to define concentricCircles with 4 parameters Use any kind of loop Within the definition of concentricCircles with 4 parameters, use any kind of loop in at least one place. Call…
- You are tasked with writing a small part of a museum's ticketing system. The museum calculates ticket prices using the following rules: $20.00 per admission. Children under 15 get a 50% discount. Seniors (60 years and older) get a 25% discount. Write a Python function that takes a list of customers' ages and returns the total cost for the group. Your function must match the docstring below. You do not need to include the docstring in your solution. '''Function -- get_ticket_costCalculates the cost of museum admission for a group.Parameter:group_ages -- A list of integers representing customer ages.Returns:The total cost for the group, a float. The return value is not rounded.''' Example get_ticket_cost([10, 39, 40]) returns 50.0I'm currently working on a project that involves programming, and I'm stuck on a particular part of the code. I would appreciate it if you could help me with the following problem: I'm trying to implement a function that calculates the factorial of a given number in Python. Here's what I have so far: def factorial(n): if n == 0: return 1 else: return n * factorial(n-1) result = factorial(5)print(result) However, when I run this code, I'm getting a "RecursionError: maximum recursion depth exceeded" error. I'm not sure what I'm doing wrong. Can you please help me understand the issue and provide a solution? Thank you!***python only *** Write a function that takes two parameters, a and b, both are strings taken from "SCISSORS", "PAPER", or "ROCK, and returns True if a wins over b according to the rules of theScissors-Paper-Rock game; False, otherwise. For example, when a is "SCISSORS" and b is "PAPER", the function should return True.
- Write a program in Python where we ask the reader to enter five positive numbers and then print thelargest one. (Hint: first write a input variable for the largest number, then write a range function.The range function should have another input variable for number input. Then do mathematicalcomparisons.)Please answer it in Python Write a double_consonant function , It takes a word as a parameter and has two return values : A Boolean value equals True If the word contains a double consonant ( The same consonant twice in a row ), under these circumstances , The second value returned is the double consonant ; If there are no double consonants , Function should return False and None. relevant information : To simplify the exercise , We don't use words that contain multiple double consonants ( for example ,“successor”) Test your functionality on . Example : double_consonne('arrivee') vaut True, 'r'.double_consonne('bonbon') vaut False, Nonedouble_consonne('reussite') vaut True, 's'Answer the given question with a proper explanation and step-by-step solution. Write a python function that accepts a string object and counts the number of vowels in the string object Example 1: Input: bear Output: a 1 e 1 strobj = 'bear' countvowels(strobj)