What is wrong with this code? This is python by the way



import random


count = 1


secret = random. Randint(1,100)


guess = int(input("Try to guess the secret number. "))


while guess != secret:


if guess secret:


guess = int(input("Too low. Try again. "))


elif guess secret:


guess = int(input("Too high. Try again. "))


count = count + 1


print("Congratulations! You’ve guessed the secret number. It took you", count, "times. ")

Answers

Answer 1

The provided code had syntax errors and incorrect indentation, which would have caused the code to fail when executed. The corrected version addresses these issues and ensures that the program runs as intended.

There are several issues with the provided code. Here is the corrected version:

import random

count = 1

secret = random.randint(1, 100)

guess = int(input("Try to guess the secret number: "))

while guess != secret:

   if guess < secret:

       guess = int(input("Too low. Try again: "))

   elif guess > secret:

       guess = int(input("Too high. Try again: "))

   count += 1

print("Congratulations! You’ve guessed the secret number. It took you", count, "tries.")

The issues and corrections:

The function name random. Randint should be changed to random.randint since the correct function name is randint with a lowercase 'r'.The lines within the while loop are not indented correctly. In Python, proper indentation is crucial for defining the scope of code blocks. The lines within the loop should be indented to be part of the loop's body.The comparison statements if guess secret and elif guess secret are incomplete. They should include comparison operators to properly compare guess with secret. The corrected conditions are guess < secret and guess > secret.The last print statement was missing a closing parenthesis after tries.

Learn more about proper indentation visit:

https://brainly.com/question/29714247

#SPJ11


Related Questions

What makes AI so powerful

Answers

AI's power lies in its ability to process vast amounts of data, identify patterns, learn from experience, and make intelligent decisions, enabling automation, optimization, and innovation across various industries.

AI is powerful due to several key factors:

Data processing: AI systems can handle enormous amounts of data, extracting valuable insights and patterns that humans might miss.Pattern recognition: AI algorithms can detect complex patterns in data, enabling them to make accurate predictions and decisions.Machine learning: AI can learn from data and improve over time without explicit programming, adapting to new situations and refining its performance.Automation: AI can automate repetitive tasks, leading to increased efficiency, productivity, and cost savings.Speed and scalability: AI algorithms can process data at incredible speeds, enabling real-time decision-making and scalability across large datasets or complex systems.Cognitive capabilities: AI can simulate human cognitive functions such as natural language processing, image recognition, and problem-solving, enabling advanced applications like virtual assistants, chatbots, and autonomous vehicles.Innovation and creativity: AI can generate novel solutions, ideas, and designs by leveraging its ability to analyze vast amounts of data and make connections that humans may not have considered.

Together, these factors make AI a powerful tool with transformative potential across various industries and domains.

For more such question on AI

https://brainly.com/question/25523571

#SPJ8





Need help with these

Need help with these

Answers

Answer:

1. D

2. B

3. D

Explanation:

vnasgbaenVmad7kDg Zg

A computer is completely compromised when it won't turn on or operate. what is the best way to fix it?

Answers

Answer: Check to make sure it is plugged into the wall first . or that the power cord is plugged into the laptop and the laptop is charged up.

Explanation:

1. (If you are on a desktop, you need to have it plugged in at all times.)

2. (On a desktop you may need a new power supply or fan if it is an old enough machine, the power supply can be replaced if that does not work you may need a new motherboard or processor chip ..you can test it with a second power supply.

3. Oh, do you have enough ventilation inside the case is the fan working on the back of the case, and are the vents on the front clogged ?? A machine needs free-flowing air from the front to back to cool down the hard drive and the DVD or cd rom players as well as the MB. Use canned air and clean those vents and spray that air everywhere inside the desktop tower ...

4. Age is also a factor when a machine gets too old it will slow down and take longer to come on till one day it just stops.

5.. ( On a desktop, you have the CMOS battery on the MB that helps keep the machine running it is the size of a watch battery and you can get it at the local store.

6.. That battery (CMOS) needs to be replaced at least once a year as it controls your time and date and the year as it is imperative to work on your motherboard for peak performance.

7. You may have a virus,use an antivirus, like AVAST and try to add it on a USB thumb drive to clean the machine outside of windows or mack

What is a negative impact of digital communication?
A.
Access to information
B.
Ability to communicate across continents
C.
Information can be difficult to verify
D.
New marketplaces for more competition

Answers

Answer:

A

Explanation:

Information such as your card number and all can get to another person which will end on a negative impact to the public community online.

can I run crisis remastered on max settings?

Answers

Yes....................................

What is
assembly language​

Answers

Explanation:

An assembly language is a type of low-level programming language that is intended to communicate directly with a computer's hardware. Unlike machine language, which consists of binary and hexadecimal characters, assembly languages are designed to be readable by humans.

a content-filtering technique where the software that performs the filtering task is placed on individual users' computers is called

Answers

The content-filtering technique where the software that performs the filtering task is placed on individual users' computers is called client-based filtering.

Content filtering can be done in several ways. It can be done by blocking specific sites, keywords, or IP addresses. It can also be done using a content filter, which can be server-based or client-based.

The filtering technique in which filtering is performed by installing filtering software on individual users' computers is known as client-based filtering.

Client-based filtering is a content-filtering technique in which filtering software is installed on individual users' computers. The client-based filtering approach has some advantages over the server-based filtering approach.

It provides more control over user access to the internet and can be configured to filter content based on user profiles. In addition, client-based filtering can be used to enforce internet usage policies in a corporate or educational setting

Client-based filtering is a content-filtering technique in which filtering software is installed on individual users' computers.

It is a useful technique in a corporate or educational setting because it provides more control over user access to the internet and can be configured to filter content based on user profiles.

To know more about content-filtering visit:

https://brainly.com/question/31217498

#SPJ11

which of the following must you do before using an unclassified laptop and peripherals

Answers

The wireless card, often known as the WIFI card, enables you to connect your computer to wireless networks and internet devices.

Putting the integrated peripherals where the old system board's did The printed circuit board used to link peripheral devices is known as the system board. It has ports and slots for connecting peripheral devices. If the laptop's system board needs to be replaced. Altering the system board is possible. All of the peripherals that were previously (old) installed on the system board should be placed on the new system board. Only the system's printed circuit board has changed because the system requirements are the same. Since the new system board is a copy of the old one, we are unable to replace the system boards' peripherals.

Learn more about Integrated peripherals here:

https://brainly.com/question/14662822

#SPJ4

Can someone pls help with this (20 points)

Can someone pls help with this (20 points)

Answers

Answer:

1. A

2. D

3. C

4. B

Explanation:

Hope this helps! Not sure if this is correct but im pretty sure the answers I gave are accurate. If Im wrong about any of the answers i put someone please correct me in the comments! :)

Hi. I want to know how to download themes or templates for PowerPoint for religious purposes (if I need to make a presentation on religions)? Any suggested websites??

Answers

Hey, you can actually do it on the PowerPoint app. If you open the app, then go on a tab ‘new’ there should be a variety of templates available for you. There’s also a search tab if you want to specify the type of templates you want. Hope this helps!

Phone Syatem Quick Reference F.... If a user of this phone system wants to find the most recently deleted message, listen to it, and then record a reply, which of the following sequences of numbers will the user select? 4,7,2 2,4,7,2 1,6,7,1 3,2,2 198 tons. However, can reach a length of 98 ft long and calc and you would be organism currenti, in the glue Mountains of eastern Oregon, thereis as much as 5 timulus question 8:2 of 2 least 7.500 tons. the covering an area of 3 square miles and estitere the an mushroom or shosstring fungus though A sus, also known as the honey to weigh such as Michigan and Germany, only Oregon's fungus has grown to such an enormous size. The humongous fungus is estimated to be anywhere from 2,000 Which of the following best describes the theme of the noever to 8,000 years old, and it continues to grow by 1 to 3 feet every year.

Answers

The correct sequence of numbers is 4, 7, 2. 4 is the number to find the most recently deleted message. 7 is the number to listen to a message. 2 is the number to record a reply.

How to explain the information

The other sequences of numbers are incorrect. For example, in the sequence 2, 4, 7, 2, the user is first trying to listen to a message, but then they are trying to find the most recently deleted message. This is not possible.

The sequence 1, 6, 7, 1 is also incorrect. In this sequence, the user is first trying to find the most recently deleted message, but then they are trying to listen to the 6th message. This is also not possible.

The sequence 3, 2, 2 is incorrect because it does not include the number to find the most recently deleted message.

Learn more about Sequence on

https://brainly.com/question/6561461

#SPJ1

If a user of this phone system wants to find the most recently deleted message, listen to it, and then record a reply, which of the following sequences of numbers will the user select?

4,7, 2

2, 4, 7, 2

1, 6, 7, 1

3, 2, 2

Name the three types of filters available in Exel 2016​

Answers

Answer:by values, by a format, or by criteria.

Explanation:do you play nitro type to if you do lets play

Anyone knows how to write a code to solve the following problem?
A idea I have is to map the bottom square ontop the top square starting from top left to bottom right, but m unsure if thats achievable
Language preferably in C++, java and python is also accepted

Anyone knows how to write a code to solve the following problem?A idea I have is to map the bottom square
Anyone knows how to write a code to solve the following problem?A idea I have is to map the bottom square

Answers

Answer:

import re

def solve(n, painting, k, stamp):

   # define a function to check if the stamp is inside the painting

   def is_in_painting(i, j):

       return i >= 0 and j >= 0 and i + k <= n and j + k <= n

   

   # define a function to check if the stamp matches the painting

   def matches_painting(i, j):

       for x in range(k):

           for y in range(k):

               if painting[i+x][j+y] != stamp[x][y]:

                   return False

       return True

   

   # try to match the stamp in each position

   for i in range(n):

       for j in range(n):

           if is_in_painting(i, j) and matches_painting(i, j):

               return True

   return False

# read in the input

input_string = """4

2

**

.*

1

*

3

.**

.**

***

2

.*

**

3

...

.*.

..."""

# parse the input string

input_lines = input_string.strip().split('\n')

n = int(input_lines.pop(0))

painting = [list(line) for line in input_lines[:n]]

input_lines = input_lines[n:]

k = int(input_lines.pop(0))

stamp = [list(line) for line in input_lines[:k]]

# solve the problem

if solve(n, painting, k, stamp):

   print("YES")

else:

   print("NO")

Explanation:

4.11 lesson practice
Need help

4.11 lesson practice Need help

Answers

Answer:

Computer modeling.

Explanation:

Computational modeling is characterized by the use of computers to represent a real world situation, that is, it is the use of mathematical models to assist in solving problems in multidisciplinary areas essential for the development of science and technology. Through computational modeling it is possible to adjust several study variables and achieve greater probabilities of reaching an effective result more quickly and at a lower cost.

Through this system it is possible to solve complex problems such as scientific research, product development, analysis and predictions about certain phenomena, development of technology applied to health, etc.

Answer:

4 is Monte carlo simulations

Explanation:

I need the other answers too

You are about to repair and change the resistor (small components),but the components are too small to solder and hold,what tool can help you hold the component so that you can replace it.​

Answers

Answer:

Needle-nose pliers

Explanation:

Required

Tool used to hold small components

The device to do this is the needle nose pliers.

This device has several functions, but it is specifically designed to hold small components in the computer when the computer is being repaired.

Among the other functions are:

Picking small and tiny screwsCutting of wiresHold wires against the side of the computer case

Which of the following led to the decline in production of LPs?

quality of LPs
appearance of LPs
cost of LPs
size of LPs

i will mark brainlist

Answers

Ahh, good ole LP’s, great sound from analog source

But SIZE, was major downfall as portable cassette/ boom boxes, CD and mp3, etc became available.

What can designers use multimedia authoring tools for?

What can designers use multimedia authoring tools for?

Answers

Answer:

A. creating and editing video

whats the best song by lil peep?

Answers

Answer:
teen romance

Explanation:

WHY DO I NEED AN EXPLANATION ITS JUST A FACT

Answer:

star shopping or witchblades

Explanation:

A 16-inch piece of string is 40.94 centimeters long. To the neareast hundredth of a centimeter, how long will a 42-inch piece of ribbon be?

Answers

Answer:

i think it's 106.68 cm

Explanation:

How can I learn programming in mobile?​

Answers

Answer:

You sadly cannot use your coding knowledge to complete things on mobile, but you can learn through YouTuube and Gooogle and such, and simple type it out in Gooogle docs or something. There are sadly no mobile friendly coding websites.

Hope This Helped!

besides entering a url to go directly to a website, what else can you enter in a browser address bar to explore the internet?

Answers

Besides entering a URL to go directly to a website, what you can also enter in a browser address bar to explore the internet is an: IP address.

DNS is an acronym for domain name system and it can be defined as a naming database in which internet domain names or website URLs are stored and translated into their respective internet protocol (IP) address.

This ultimately implies that, a domain name system (DNS) is used to connect a uniform resource locator (URL) or a web address with its internet protocol (IP) address.

On a related note, you can either enter a uniform resource locator (URL) or an internet protocol (IP) address in a web browser address bar to explore the internet.

Read more: https://brainly.com/question/17273205

Draw an electic bettle and label 3.​

Answers

Explanation:

hope it helps thank you❤

Draw an electic bettle and label 3.

help
pls need quickly

helppls need quickly

Answers

Answer:

Themes

Explanation:

In the slide thumbnail pane on the left, select a slide.On the Design tab, in the Themes group, click the More button (illustrated below) to open the entire gallery of themes:Point the mouse at the theme you want to apply. Right-click it, and then select Apply to All Slides.

A good first step to understanding any kind of text is to :
A. take careful notes
B. create meaning
C. focus on the details
D. find the main idea

Answers

Answer:

find the main idea

Explanation:

What is the correct HTML for adding a background color?


Question 7 options:


< background>yellow


< body background-color=yellow>


< body bg="yellow">


< body style="background-color:yellow;">

Answers

Answer:

< body background-color=yellow>

Explanation:

This is the correct HTML command that is used for adding a background color of choice.

if you have a class defined in separate files, and change the main program, which files need to be re-compiled?

Answers

The application and implementation files must be recompiled if a class is declared in separate files and the main program is changed.

What version of the class file is it?

We designate the class file's version as M.m, where M stands for the major version and m for the minor version. Note: Compiler developed by lower version. High version JVM may run class files, but higher version compiler created. Class files cannot be run by JVM versions below that.

What do you name the process of joining the implementation and application files to create an executable file?

Linking is the process of combining the implementation and application files to create an executable file.

To learn more about Java class visit:

brainly.com/question/14615266

#SPJ4

3. (10 pts) Tommy has an extensive collection of digital photos taken during adventures in nature and
biking trips over the years. They are currently stored on his computer's hard drive. He d like to
make back-up copies of them on USB flash drives. Suppose one flash drive has a 32 GB capacity and each image file has a size of 12.5 MB.

If each flash drive can store/transfer photos at a rate of 60 MBps (Megabytes per second), how long would it take to transfer the entire collection from the hard drive to the flash drive?

Answers

How many photos does he have?

If each flash drive can store/transfer photos at a rate of 60 MBps (Megabytes per second) than it will take 30 minutes to transfer the entire collection from the hard drive to the flash drive.

Who has extensive collection of digital photos?

Tommy has an extensive collection of digital photos taken during adventures in nature and biking trips over the years. They are currently stored on his computer's hard drive. He d like to make back-up copies of them on USB flash drives. Suppose one flash drive has a 32 GB capacity and each image file has a size of 12.5 MB.

This ultimately implies that, an operating system (OS) acts as an interface (intermediary) between an end user and the hardware portion of the computer system (computer hardware) in the processing and execution of instructions, including the management of the random access memory (RAM).

Therefore, If each flash drive can store/transfer photos at a rate of 60 MBps (Megabytes per second) than it will take 30 minutes to transfer the entire collection from the hard drive to the flash drive.

Learn more about flash drive on:

https://brainly.com/question/15263464

#SPJ2

The ethernet cable is also known as? *
Cat 5 cable
Wan cable
RD-45 cable
Sat 5 cable​

Answers

Answer:

Cat 5 cable

Explanation:

The ethernet cable is also known as Cat 5 cable.

____________________ multiplexes or separates the data to be transmitted into smaller chunks and then transmitted the chunks on several sub channels.

Answers

Answer:

no one knows

Explanation:

What do HIPAA guidelines protect?

Answers

Answer:

They protect patient medical records im pretty sure

Explanation:

Other Questions
Find the area of the regi x = y2 - 6 = 11 11 ) 2 X - 10 5 5 x=5 y - y2 -5 Question 2: Let X and Y be continuous RVs with normal distributions, X-N(3,4), Y~N(-4,9) and Z = 4 - 3X - 2Y a) Find P(Z > 2) b) Find P(3 > Z > 1) his c) Find P(Z > 31Y 5) ILL GIVE BRAINLY!!Blogs differ from most other online text sources because theyfocus on news and information.allow readers to interact with each other.are usually updated every day.can be updated with new information. Which of the following best describes how the boundaries of the United States changed between 1812 and 1821?The U.S. purchased the Florida Territory from Spain and seven states were admitted into the union.The Louisiana Territory was purchased from France and four states were admitted into the union.The Northwest Territory was settled and the Louisiana Territory was purchased from France.Alaska was purchased from Russia and the Florida Territory was purchased from Spain. Let w = yz/ x where x = t^2 , y = r + t and z = r t. Find w/ t and w/ r (a) by using Chain Rule, (b) by converting w into the function of t and r before differentiating. Aiden evaluated the expression to find the volume of a cylinder. What could be dimensions of the cylinder Please assess positive and negatives of the years from 1789 to 1865. When we look back at our countrys history, what can we see as achievements or progress of these years? What can we see as negatives or low points? This is a very broad question, so please discuss no more than five to six major developmentsat least two positives and at least two negatives. Developments that you may want to discuss include the market revolution, slavery, the Bill of Rights, etc. Please make sure to be specific enough in discussing these developments. what words related to the greek or latin word circum (v)-to sail around the world Hola ;D No tengo preguntas asi que quiero llamar tu atencion1. Hola Sigue Leyendo2. Lee los numeros que van a ver aqui abajo3. 12364542738462543284957463535930659674569706797729340249584556562764039274. Por que no leiste los numeros completos?5. Bueno no improta6. Sabes que ay no decia importa decia improta7. ASI SE LLAMA LA ATENCIAON ;) SOLVEEEEEE XXXXXXXxx Valeria's business is covered by a BOP. Which is not possiblyValeria's business? Select one:a. A nightclub located on the top floor of the tallest buildingdowntown b. A 5,000-square foot dry cleane Examine these points on line u and line v. Line u: (9, 8), (5, 4) Line v: (4, 2), (7, 7) How many points of intersection are there between line u and line v? Why do clams not have eyes? How can having good Life Skills help you cope with all the demands of your daily life? Elaborate on at least 3 of the Life Skills. an administrator configured a new mail server. which record must the administrator update for the server to send mail from the domain? 5. How does the researchers' experiment with Reddit contribute to the central idea of the text?Answer it as brief and simple as possible. Thank a lot. 1. Darrell determines that it costs $1,200 to run the movie theater for a givenday. The cost of a movie ticket is $9.A. Write a function Darrell can use to determine the profit for the movietheater for one day. An investment is be made with an initial capital of PHP 842693. It is expected that there will be an annual revenue for this investment of PHP 378213; while it also entitled to an annual operations nd maintenance cost of PHP 37315 and annual taxes of PHP 7289. Its salvage value at the end of its useful life (10 years) is PHP 13122. This investment has a MARR of 18% (same as interest rate). Determine the Annual Worth of the investment using Annual Worth Method. Given an interest rate of 4.3% compounded quarterly and the first payment of Php9697 was made at the end of the first quarter: Determine the present worth of the 12 quarterly payments wherein the succeeding quarterly payments increase by 7% of the first payment. (pls use complete decimal places within the solutions) 18.9 divided by 0.7 i need help (10 + 3x) = 5xSolve please