Skip to content

Commit

Permalink
Merge pull request #6677 from bevnign/patch-6
Browse files Browse the repository at this point in the history
Create Data input from the keyboard.py
  • Loading branch information
ossamamehmood authored Oct 31, 2023
2 parents d4406bb + 8eefa36 commit 41c2929
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Add Code Here/PYTHON/Data input from the keyboard.py
Original file line number Diff line number Diff line change
@@ -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))

0 comments on commit 41c2929

Please sign in to comment.