diff --git a/Add Code Here/PYTHON/Data input from the keyboard.py b/Add Code Here/PYTHON/Data input from the keyboard.py new file mode 100644 index 00000000000..c759e73101b --- /dev/null +++ b/Add Code Here/PYTHON/Data input from the keyboard.py @@ -0,0 +1,7 @@ +#To enter data from the keyboard in Python we use input(""), and we can add an int() before it to make it so that only int-type data can be entered. +name = input("Enter your name: ") +num = int(input("Enter a number: ")) + +print("Your name is: " + name) +#In Phyton we use str() to convert an int variable to a string variable to display the contents as a string. +print("Your number is: " + str(num))