What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-22 04:40:02
python check if input() gives error
try: # Note: Python 2.x users should use raw_input, the equivalent of 3.x's input age = int(input("Please enter your age: ")) except ValueError: print("Sorry, I didn't understand that.") else: if age >= 18: print(... Add solution -
Other 2021-12-23 17:22:22
tkinter trig calculator
import tkinter as tk from tkinter import ttk window = tk.Tk() v = tk.IntVar() v.set(1) x1String = "x1: " x2String = "x2: " y1String = "y1: " y2String = "y2: " window.geometry("640x860") submit = tk.Bu... Add solution -
Python 2021-12-23 17:20:09
how to get int input in python
# To prompt the user to input an integer we do the following: valid = False while not valid: #loop until the user enters a valid int try: x = int(input('Enter an integer: ')) valid = True #if this point is reached, x is a valid int ... Add solution
Best helpers
Ranking is empty