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
ASHA 777 [7]
4 years ago
11

what is the string of code to make a variable change pls make this into this code, this is pygame btw import pygame import time

pygame.init() screen = pygame.display.set_mode([800,600]) keep_going = True WHITE = (255,255,255) BLACK = (0,0,0) BALL_SPEED_X = 5 BALL_SPEED_Y = 5 score = 0 # ball variables posx = 100 posy = 100 speedx = BALL_SPEED_X speedy = BALL_SPEED_Y radius = 14 #paddle variables paddley = 300 paddlex = 1 paddle_length = 100 paddle_speed = 5 while keep_going: for event in pygame.event.get(): if event.type == pygame.QUIT: keep_going = False # ball movement posx += speedx posy += speedy if posx - radius paddley + paddle_length/2) or (posy = 1: print(" You Lose!") exit() speedx = BALL_SPEED_X speedy = BALL_SPEED_Y posx = paddlex + 10 posy = int(paddley) else: speedx = -speedx elif posx + radius >= 800: speedx = -speedx elif posy - radius = 600: speedy = -speedy # paddle movement if paddley - paddle_length/2 = 600: paddley = 599 - paddle_length/2 else: key_object = pygame.key.get_pressed() if key_object[pygame.K_UP]: paddley -= paddle_speed elif key_object[pygame.K_DOWN]: paddley += paddle_speed # draw the screen elements screen.fill(BLACK) pygame.draw.circle(screen, WHITE, (posx,posy), radius) pygame.draw.rect(screen, WHITE, (paddlex,paddley - paddle_length/2, 5,paddle_length)) pygame.display.update() # slow things down time.sleep(0.02) pygame.quit()
Computers and Technology
1 answer:
Paul [167]4 years ago
3 0

Answer:

If you want to change a variable, just re-define it.

For example:

colour = print("red")

To change the value of the colour variable, just type:

colour = print("orange")

If you want the user to input text that changes the variable, do this:

colour = input("pick a colour")

Hope it helps ! :)

You might be interested in
What does network administration normally include? Check all of the boxes that apply.
Paul [167]

Answer: design of the network

security for the network

documentation

identifying and fixing issues

Explanation: I just took the test

8 0
4 years ago
What are the six critical components of an information system? Select three of the six components, and describe a potential vuln
Blizzard [7]
People, procedures and instructions, data, software, information technology infrastructure, internal controls.
7 0
3 years ago
All of the following are functions of the DBMS except ________. Group of answer choices modifying the database getting the users
andreev551 [17]

Answer:

None of the above.

Explanation:

The outlined options are all functions of DBMS.

3 0
3 years ago
Select the correct answer from each drop-down menu.
Lelu [443]

Answer:

First: .Net

Second: New Zealand

Explanation:

Net is short for Network.

NZ means New Zealand.

3 0
4 years ago
Read 2 more answers
CHALLENGE ACTIVITY 7.3.1: Functions: Factoring out a unit-conversion calculation. Write a function so that the main() code below
77julia77 [94]

Answer:

See Explaination

Explanation:

#include <stdio.h>

MphAndMinutesToMiles()

{

double milesPerHour;

double minutesTraveled;

double hoursTraveled;

double milesTraveled;

scanf("%lf", &milesPerHour);

scanf("%lf", &minutesTraveled);

hoursTraveled = minutesTraveled / 60.0;

milesTraveled = hoursTraveled * milesPerHour;

printf("Miles: %lf\n", milesTraveled);

}

int main()

{

MphAndMinutesToMiles();

return 0;

}

4 0
4 years ago
Other questions:
  • Clunker Motors Inc. is recalling all vehicles from model years 1995-1998 and 2004-2006.Given a variable modelYear write a statem
    5·1 answer
  • Suppose that the following regular expression is used to recognize real numbers in scientific notation in a programming language
    14·1 answer
  • Which language is the most popular language for writing apple os x?
    9·1 answer
  • Encapsulation is the process of “packaging” information prior to transmitting it from one location to another. true or false
    14·1 answer
  • A program executes 100 billion instructions. It executes on an IBM processor that has an average CPI of 1.2 and a clock frequenc
    15·1 answer
  • If number is 20, what is printed to the console after this code is executed?
    13·1 answer
  • What is the purpose for using proper markup language
    8·2 answers
  • Write a program that uses the Purchase class in 5.13. Set the prices to the following: Oranges: 10 for $2.99 Eggs: 12 for $1.69
    11·1 answer
  • Data is communicated through various input devices true or false​
    8·1 answer
  • Display the desktop without minimizing or closing any windows.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!