hello.py
= input("Please tell me your name: ")
my_name
= len(my_name)
name_length
print(f"Hello {my_name}! Your name is {name_length} characters long")
To get input from the person running your script, you can use the function input()
. And to get the length of your variable you can call len()
.
hello.py
= input("Please tell me your name: ")
my_name
= len(my_name)
name_length
print(f"Hello {my_name}! Your name is {name_length} characters long")
Please tell me your name: Jean
Hello Jean! Your name is 4 characters long