Skip to content

Instantly share code, notes, and snippets.

@makwanadeepam
Created March 27, 2024 18:36
Show Gist options
  • Select an option

  • Save makwanadeepam/1293bdd5e3b8900a2fcd849783ff4040 to your computer and use it in GitHub Desktop.

Select an option

Save makwanadeepam/1293bdd5e3b8900a2fcd849783ff4040 to your computer and use it in GitHub Desktop.
name=input("Enter your name: ")
# input function by default takes string arguments
try:
x=input("Enter number to add with 5: ")
print(x+5)
except:
print("Error")
# What do you think happened?
x=int(input("Enter number to add with 5 part 2: "))
print(x+5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment