You are on page 1of 4

1/28/2021 Python for O&G lecture 8- Input Function - Part 2 - Colaboratory

Python for Oil and Gas

Website - https://petroleumfromscratchin.wordpress.com/

LinkedIn - https://www.linkedin.com/company/petroleum-from-scratch

YouTube - https://www.youtube.com/channel/UC_lT10npISN5V32HDLAklsw

branch, sub = input('What is your engineering branch and which subject do you like the most? ')

/
1/28/2021 Python for O&G lecture 8- Input Function - Part 2 - Colaboratory

What is your engineering branch and which subject do you like the most? Petroleum Reservoir
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-75f57037cb32> in <module>()
----> 1 branch, sub = input('What is your engineering branch and which subject do you like the most? ')
branch, sub = input('What is your engineering branch and which subject do you like the most? ').split()
ValueError: too many values to unpack (expected 2)
What is your engineering branch and which subject do you like the most? Petroleum Reservoir

SEARCH STACK OVERFLOW


print(branch)

Petroleum

print(sub)

Reservoir

branch, sub = input('What is your engineering branch and which subject do you like the most? ').split()

What is your engineering branch and which subject do you like the most? PetroleumReservoir
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-6-6746823e96ee> in <module>()
----> 1 branch, sub = input('What is your engineering branch and which subject do you like the most? ').split()

ValueError: not enough values to unpack (expected 2, got 1)

SEARCH STACK OVERFLOW

branch, sub = input('What is your engineering branch and which subject do you like the most? ').split(',')

What is your engineering branch and which subject do you like the most? Civil, SOM

print(branch) /
1/28/2021 Python for O&G lecture 8- Input Function - Part 2 - Colaboratory

Civil

print(sub)

SOM

branch, sub = input('What is your engineering branch and which subject do you like the most? ').split(',')

What is your engineering branch and which subject do you like the most? Civil SOM
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-10-1c45e385b924> in <module>()
----> 1 branch, sub = input('What is your engineering branch and which subject do you like the most? ').split(',')

ValueError: not enough values to unpack (expected 2, got 1)

SEARCH STACK OVERFLOW

Assignment 4

# make computer ask you a question 'Do you like memes?'


# Store this question in a variable called 'quest'
# Then print a statement with your response using string formatting. Yes, I like memes or No, I don't like memes

/
1/28/2021 Python for O&G lecture 8- Input Function - Part 2 - Colaboratory

You might also like