Talk:Python (programming language)
Add topicAppearance
Latest comment: 3 months ago by SeaDragon1 in topic C.S.
To-do list for this page
[change source]- Add history
- Way more detail on syntax
- Implementations
- Usage
Notfruit (talk) 01:03, 4 January 2016 (UTC)
- Hello Mates,
- After reading the following article "https://optymize.io/blog/python-install-mac-tutorial/" I feel like this will be the best source for this page. Please review it and let me know if the article is good to add to the Reference section.— Preceding unsigned comment added by Aatifnation90288 (talk • contribs) 15:52, 21 March 2023 (UTC)
- @Aatifnation90288: How would a mac installation tutorial be the best source? DingoTalk 15:57, 21 March 2023 (UTC)
C.S.
[change source]A=int(input ("enter no."))
2402:8100:2732:EBBD:79F1:6D9C:F55A:6C42 (talk) 16:40, 10 July 2025 (UTC)
- For this:
A=int(input ("enter no."))
print(A)- If input is 1, it prints 1 to the console.
- If input is A, it throws an error (
ValueError: invalid literal for int() with base 10: 'A'). - So, try this:
- def inpnum()try:return int(input("Enter number: ")except ValueError:return inpnum() # Note that this will cause a RecursionError if this is called too many times, but this shouldn't be a worry.
print(inpnum()) - This implements what is known as a try-catch block, so the program doesn't halt when it encounters the error. Hope this helps! SeaDragon1 (talk) 15:21, 11 February 2026 (UTC)