Nov-16-2017, 01:21 AM
Hey all. Python Newbie here. Taking CEIS 100 at DeVry and this weeks Lab has me stumped. We are to write a script the prints out the following:
Who are you and where are you from
What is your name? Frank
Which city do you live in? Hinesville, GA
What is the temperature? 50
It is cold where you live
Frank
You live in:
(city you imputed above).
I got the code for all of it except the last line. How do I get it to print the city I input? code and Traceback I got is :
print("Who are you and where are you from")
name = input("What is your name? ")
city = input("Which city do you live in? ")
temperature = float(input("What is the temperature? "))
if temperature>=60:
print("It is nice where you live.")
if temperature<=59:
print("It is cold where you live")
print(name)
print("You live in:")
print(city=input)
Traceback:
Traceback (most recent call last):
File "C:/Users/Frank/Desktop/DeVry/CEIS 100/Week 4/Who and Where2.py", line 11, in <module>
print(city=input)
TypeError: 'city' is an invalid keyword argument for this function
Any help is appreciated.
Thanks,
Frank
Who are you and where are you from
What is your name? Frank
Which city do you live in? Hinesville, GA
What is the temperature? 50
It is cold where you live
Frank
You live in:
(city you imputed above).
I got the code for all of it except the last line. How do I get it to print the city I input? code and Traceback I got is :
print("Who are you and where are you from")
name = input("What is your name? ")
city = input("Which city do you live in? ")
temperature = float(input("What is the temperature? "))
if temperature>=60:
print("It is nice where you live.")
if temperature<=59:
print("It is cold where you live")
print(name)
print("You live in:")
print(city=input)
Traceback:
Traceback (most recent call last):
File "C:/Users/Frank/Desktop/DeVry/CEIS 100/Week 4/Who and Where2.py", line 11, in <module>
print(city=input)
TypeError: 'city' is an invalid keyword argument for this function




Any help is appreciated.
Thanks,
Frank