User Input & Math Functions in Python by CodingXpertz

Publié le: 18 février 2023
sur la chaîne: Coding Xpertz
386
3

It is extremely important to be able to except input from users and Python makes it easy. The
input() function displays a message and then assigns the users input up until they hit return
(issue a newline) to a variable. That input is always a string so be prepared to cast if needed.
CODE
Name = input(‘What is your name :’)
print(‘Hello’, name)
You can also except 2 or more values with one input() function. Here we will ask for and then
add together 2 numbers. I’ll also subtract, multiply, divide and use modulus on the values.
Modulus returns the remainder of a division.
I’ll also cast the strings to integers. The split() function splits user input based on whitespace
between values


Sur cette page du site, vous pouvez voir la vidéo en ligne User Input & Math Functions in Python by CodingXpertz durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Coding Xpertz 18 février 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 386 fois et il a aimé 3 téléspectateurs. Bon visionnage!