I was written the python program, am getting error message "IndentationError: expected an indented block"

0 votes
size_of_cargo1 = input()#take size of cargo number 1 as input from user
size_of_cargo2 = input()#take size of cargo number 2 as input from user
size_of_cargo3 = input()#take size of cargo number 3 as input from user
size_of_cargo4 = input()#take size of cargo number 4 as input from user
Raegan_cargo = input()

#if size of all the cargos is less than the Raegan cargo number, it means the Raegan container will not be filled in any container
if(size_of_cargo1+size_of_cargo2+size_of_cargo3+size_of_cargo4<=Raegan_cargo):
   print("Not Possible\n")
else:
#if raegan cargo number is between 0 to (size_of_cargo1-1),
if(Raegan_cargo-size_of_cargo1<0):
    print "1"
#if raegan cargo number is between size_of_cargo1 to (size_of_cargo2-1),
elif (Raegan_cargo-size_of_cargol-size_of_cargo2<0):
    print "2"
#if raegan cargo number is between size_of_cargo2 to (size_of_cargo3-1),
elif (Raegan_cargo-size_of_cargol-size_of_cargo2-size_of_cargo3<0):
    print "3"
#if raegan cargo number is between size_of_cargo3 to (size_of_cargo4-1),
else:
    print "4"

File "<string>", line 12
    if(Raegan_cargo-size_of_cargo1<0):
    ^
IndentationError: expected an indented block
>>>
May 27 in Python by anonymous
• 120 points

edited May 27 by Gitika 661 views

1 answer to this question.

0 votes

Hi@Thiyagarajan,

You have one else block in your code. But you didn't write anything inside this block.

if(size_of_cargo1+size_of_cargo2+size_of_cargo3+size_of_cargo4<=Raegan_cargo):
   print("Not Possible\n")
else:
#if raegan cargo number is between 0 to (size_of_cargo1-1),

If your below code comes under this else block, then indent your below code with respect to this else block.

answered May 27 by MD
• 41,340 points

Related Questions In Python

0 votes
2 answers

Python error "IndentationError: expected an indented block"

Putting in an extra space or leaving ...READ MORE

answered Mar 2 in Python by evanbung
• 180 points
36,393 views
0 votes
1 answer

Why am I getting a error when I am printing two different data types in python?

different data type is being used. that ...READ MORE

answered Mar 6, 2019 in Python by Mohammad
• 3,210 points
99 views
0 votes
1 answer

how do I check the length of an array in a python program?

lets say we have a list mylist = ...READ MORE

answered Mar 12, 2019 in Python by Mohammad
• 3,210 points
193 views
0 votes
1 answer

i am normalizing the data set iris in python and get the error ::TypeError: 'numpy.float64' object is not callable

TRY THIS   #Nomalisation for i in names:     print(i)   ...READ MORE

answered Aug 19, 2019 in Python by Noel Deepak Palle
2,449 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,190 views
0 votes
0 answers
+4 votes
6 answers
0 votes
1 answer

I got expected an indented block error.

Hi, You used one function in your code, ...READ MORE

answered Jun 16 in Python by MD
• 41,340 points
338 views
0 votes
2 answers

i am installing wordcloud using pip but i am unable to do that ....i am getting the following error

Hi@Prajwala, First check your pip and python version ...READ MORE

answered Apr 15 in Python by MD
• 41,340 points
1,700 views