Can not chat

#1
by JaheimLee - opened

As you said, it's a chat version. But when I chat with it, like asking "What's your name?", the output is nonsense.

What's your name?

A:

Your code is correct. The problem is that the value of "name" is a string, and it is being used as a variable name. You need to assign the value of the "name" variable to something else.
In this case, you can use a different variable name, like "name2".
name2 = name.split(" ")

If you want to get the last word in the string, you can use the "last" method.
name2 = name.split(" ")
last_word = name2[-1]

A:

name = "joe"
name = name.split(" ")
name = name[-1]
print(name)

Output:
jo

Or
name = "joe"
name = name.split(" ")
name[-1] = name[-1].replace(" ", "")
print(name)

Output:
jo

1. Field of the Invention
The present invention relates to a method and apparatus for providing a user with a service in a wireless communication system, and more particularly, to a method and apparatus for providing a service in a wireless communication system in which a mobile station is located in a coverage area of a base station.
2. Description of the Related Art
A wireless communication system is widely used to provide voice and data services to Mobile Stations (MSs) such as a mobile phone, a Personal Digital Assistant (PDA), a laptop computer, and a Portable Multimedia Player (PMP). A mobile communication system can be categorized as a wireless Local Area Network (LAN) system and a wireless Metropolitan Area Network (MAN) system according to the mobility of the MSs. The wireless LAN system is a system in which the MSs move within a limited area, such as a home or an office, and thus the MSs are connected to the Internet or an intranet. The wireless MAN system is a system in which the MSs move freely within a wide area, such as a building, a campus, and a city, and thus the MSs are connected to a core network of the mobile communication system.
The wireless MAN system includes a Wireless Metropolitan Area Network (WMAN) and a Wireless Metropolitan Area Network (WMAN). The WMAN includes a Wireless Metropolitan Area Network (WMAN) and a Wireless Metropolitan Area Network (WMAN). The WMAN is a wireless communication system that provides a service in a limited area such as a home or an office, and includes a Wireless Metropolitan Area Network (WMAN). The WMAN is a wireless communication system that provides a service in a wide area such as a metropolitan area and a town or a city, and includes a Wireless Metropolitan Area Network (WMAN).
A mobile station (MS) is a wireless communication device that can transmit and receive data. The MSs include a cellular phone, a Personal Digital Assistant (PDA), a laptop computer, and a Portable Multimedia Player (PMP). The MSs are classified into a mobile station (MS) and a portable station (PS) according to mobility. The MS is classified into a mobile station (MS) and a portable station (PS) according to mobility.
The MS is a wireless communication device that can receive a service in a wireless communication system. The MS includes a cellular phone, a Personal Digital Assistant (PDA), a laptop computer, and a Portable Multimedia Player (PMP). The MS is a wireless communication device that can receive a service in a wireless communication system. The MS includes a cellular phone, a Personal Digital Assistant (PDA), a laptop computer, and a Portable Multimedia Player (PMP).
The MS is connected to a Core Network (CN) of a mobile communication system. The MS is connected to the CN through a Radio Network Controller (RNC). The RNC is connected to a Base Station (BS) through a Node B. The BS is connected to the MS through a radio channel. The BS is connected to the CN through a Core Network (CN). The BS is connected to the MS through a radio channel.
The RNC is connected to the CN through a Node B. The RNC is connected to the BS through a Node B. The RNC is connected to the BS through a Node B. The RNC is connected to the BS through a Node B. The RNC is connected to the BS through a Node B. The RNC is connected to the BS through a Node B. The RNC is connected to the BS through a Node B.
The BS is connected to the CN through a Core Network (CN). The BS is connected to the CN through a Core Network (CN). The BS is connected to the CN through a Core Network (CN). The BS is connected to the CN through a Core Network (CN). The BS is connected to the CN through a Core Network (CN). The BS is connected to the CN

Sign up or log in to comment