Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Answer to Question #341372 in Python



Note:Error is displaying in this code, please correct it

Enter the number of societies:Keep the number of people in societies:

Traceback (most recent call last):

 File "main.py", line 4, in <module>

  num_people = int(input('Keep the number of people in societies:'))

ValueError: invalid literal for int() with base 10: '\r'


Create an application that calculates your daily driving cost, so that you can estimate how much money could be saved by carpooling, which also has other advantages such as reducing carbon emissions and reducing traffic congestion. The application should input the following information and display the user’s cost per day of driving to work: 

a) Total miles driven per day. 

b) Cost per gallon of gasoline. 

c) Average miles per gallon.

d) Parking fees per day. 

e) Tolls per day.


A window with the title “Welcome Home”

What is the output of the following code?


int x = 100;


int y = 200;



if (x > 100 && y <= 200)


System.out.println(x + “ “ + y + “ “ + (x + y));


else


System.out.println(x + “ “ + y + “ “ + (2 * x - y));

Declare the Person superclass as abstract. Add this abstract method to the class:

public abstract void eat(String food);

Both the Student and Employee class inherit from abstract superclass Person, and provides an implementation for eat() which displays that the student or employee is eating a certain food.

(Note what happens if you don’t implement eat().)



Create an interface called StudentInterface. This interface has the following abstract method:

public void study(String subject);

The Student class implements this interface, and provides an implementation for study() which displays that the student is studying a certain subject.

(Note what happens if you don’t implement study().)


Write a program in Python programming language, which allows the user to input an integer value. Based on the input values, the program should perform the following tasks:


⦁ If the entered value is negative then it should print “Factorial does not exist for negative numbers”.

⦁ If the entered value is 0 then it should print “The factorial of 0 is 1”.

⦁ Calculate and display the factorial of the given integer.



Write a program in Python programming language, which allows the user to input a number and upper limit, and based on the input values, the program should perform the following tasks:

⦁ Check whether the value entered by the user is a positive integer.

⦁ Generates an error massage in case of negative integer.

⦁ Generate a table of given number.

⦁ Upper limit for table will be get from user.



One box have some apples and another box have some oranges, develop a C++ program to find the sum of fruits and double the sum of fruits in the box using call by address concept

Create an array of size 12. Swap values of 8th and 11th index and display the changed array on screen.

LATEST TUTORIALS
APPROVED BY CLIENTS