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
Over [174]
3 years ago
12

It is telling me that I have an invalid syntax error in my code (I am using Python3, btw). What is wrong with it? The code is be

low:
num = float(input("What is your first number, %s? (Enter the first you will be using): " %(name, )))
Computers and Technology
1 answer:
elena55 [62]3 years ago
4 0
I copied and pasted your post into my Python3.5.1 interpreter and got:

>>> name = "roger"
>>> num = float(input("What is your first number, %s? (Enter the first you will be using): " %(name, )))
What is your first number, roger? (Enter the first you will be using): 43.0
>>> num
43.0

Your code looks good, and runs good. At this point, I'd be suspicious that you're trying to execute this on a Python2.x interpreter. Try this (I translated to PythonV2 and tested it):

num = float(raw_input("What is your first number, %s? (Enter the first you will be using): " %(name, )))



You might be interested in
Write a python function genRandomVect that returns a random 1d numpy array of size (50,) where each element is an integer sample
SSSSS [86.1K]

Answer:

import numpy as np

def genRandomVect():

   arr = np.random.choice(range(100),size=(50,),replace=False)

   return arr

 

print("Random 1D numpy array where each element is an integer sampled from: [0, 100) ")

print( genRandomVect() )

Explanation:

  • Create a function to create a numpy array with random integers in range[0,100) with no duplicates
  • Use the random.choice to select random values from range[0,100)  and size attribute to take the size of the required array .
  • Finally return the numpy array.

6 0
3 years ago
Many everyday objects (such as amusement park rides, cars, elevators, and ovens) that you might not normally associate with a co
lisabon 2012 [21]

Answer:

Major risks include computer security and maintability of the software and hardware components of the computers in these objects.

I may feel more scared if I was riding a roller coaster that was computer controlled because if there were vunerabilities in the computer's software, a hacker could exploit that and remotely have access to the controls of the roller coaster, putting many people's lives at risk.

I think the benefits of computerizing an increasing number of everyday objects outweigh the potential risks.

This is because computers is very reliable and they do exactly what you tell them to do. However, humans are clumsy and can sometimes be extremely stubborn. Computerizing more everyday objects is an overall good thing for society, however, policies and protocols need to be followed to ensure these computerized objects remain secure.

Explanation:

Hope this helps.

4 0
3 years ago
How to use a structured reference to look up the value in the service years column in excel
pav-90 [236]

Answer: understand?

Structured Reference is a special feature of Excel that references tables. It makes our formulas easier to understand and automatically adjusts whenever there are changes in our data.

Explanation:

5 0
2 years ago
Suppose you have a class Ship, which was written by another programmer who used to work for your employer. Ship is used in sever
liq [111]

Answer:

Research of the GPS features and the modules and packages needed by the programming language to implement and receive data from a GPS tracker.

Explanation:

The Ship class is a blueprint that holds a data structure of a ship's location in coordinates. The location variable can be changed using the getBearing method and an instance of the ship class can be made several times for different ships in the harbor. This class depicts the power of object-oriented programming.

Refactoring is a concept in software engineering where source codes are modified to achieve code efficiency and speed. All programming language source code should be refactored where needed with the right packages or modules.

7 0
3 years ago
Which describes the conditions that must be met in order to use Subtotal in a spreadsheet? The data must be in adjacent cells an
pantera1 [17]
The answer is (B): The data must be in adjacent cells and organized in columns using headings.

You can always add subtotals that contain the same function to several columns at the same time. In most cases, subtotals evaluate values based on categories in another column. For instance, when the value in column A changes, the corresponding value in column B is evaluated.

8 0
3 years ago
Other questions:
  • Data cannot be sorted of filtered accurately if there are ________.
    10·2 answers
  • What is the term for sending emails that imitate legitimate companies?
    6·2 answers
  • PLEASE HELP ME!!!!
    12·2 answers
  • Input and Output. Keep the program running in a Do-While Loop or While Loop. Conditional statements. User defined functions for
    6·1 answer
  • Tree diagrams are useful for
    12·1 answer
  • The memory unit of a computer has 2M Words of 32 bits (or 4 bytes) each. The computer has an instruction format with 4 fields: a
    14·1 answer
  • What is the purpose of HTML?
    7·1 answer
  • Write a lottery program that will ask the user if they would like to pick 5 numbers (1-30) or if they would like to choose EZ Pi
    5·1 answer
  • ITS A VOTE I NEED HELP
    12·1 answer
  • In object-oriented analysis, an object is a member of a(n) _____, which is a collection of similar objects.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!