+ 4
I may be stupid for this,but what is a float, input, and strings? I'm a beginner so it doesn't quite click yet. Thanks!
Thank you! If you have anymore hard vocabulary please tell me. Thanks!
4 Réponses
+ 6
Never feel bad for asking!
float is a data type meant to hold numbers with decimal parts like 0.836 or 3.14 (called a floating point). BTW, double is more accurate than float and holds greater numbers.
input() is a method that outputs a prompt, and waits for the user to give an input. Ex:
name = input("Enter your name:\t")
string is a data type that holds text. Text is denoted with quotes. Ex: string subject = "History"
+ 3
Thank you! ^^
+ 2
Worth adding that input() always return string as result. So if you think of receiving a number, you have to convert it by using int() for integers or float() for floats.
+ 1
it's not stupid to ask something
i'll keep it as simple as i can
a float is just a number that is not a whole like 1.1 or 5.5(5.5 + 4.5 = 10)
input is asking sonething from a user like:
name = input('what is your name: ')
print('hello ' + name)
output:
what is your name: yunus <-- this is the input
hello yunus
and strings are everything between ' ' or " "
print("this is a string") or print('this is a string')