<jupyter_start><jupyter_text>Exercises 04. Validation challenge<jupyter_code>user_input = input("Type something: ")

try:
    input_type = int(user_input)
    print(type(input_type))
except ValueError:
    try:
        input_type = float(user_input)
        print(type(input_type))
    except ValueError:
        print(type(user_input))<jupyter_output><empty_output><jupyter_text>Theory “Primitive” types<jupyter_code>int_input = int(input("Enter an integer: "))
float_input = float(input("Enter a float number: "))

print("Is the first number higher than the second?")

if bool(int_input > float_input):
    msg = str("Yes, it is!")
else:
    msg = str("No, it isn't.")

print(msg)<jupyter_output><empty_output><jupyter_text>Printing<jupyter_code>int_input = int(input("Enter an integer: "))

print("Your answer:", int_input)
print("Your answer: {}".format(int_input))
print(f"Your answer: {int_input}")

print(type(int_input))<jupyter_output><empty_output><jupyter_text>Some methods<jupyter_code>user_input = input('Type something: ')

print(user_input.isnumeric())
print(user_input.isalpha())
print(user_input.isalnum())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1422376409366869, 'fraction_numerical': 0.0017346053772766695, 'mean_word_length': 6.958620689655173, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '376556', 'license': 'MIT', 'n_tokens_mistral': 413, 'n_tokens_neox': 411, 'n_words': 69, 'path': 'Lesson 06 - Primitive types and data output/Exercises and theory.ipynb', 'repo_name': 'tofolo17/PythonCeV', 'size': '1153'}