+ 2

Hello, i'm a beginner. Please be kind to my foolish question like " which one is the string here 42, 5.0, "hi evryone"?

6th Jul 2022, 7:53 PM
Sayeed Rashed
Sayeed Rashed - avatar
6 Réponses
+ 2
int ( integer) mean the number which is not fractional value. float or double mean the fractional number. string meant one line of sentence. it can store any character ( letter, special characters, digit). for example " it's time 10 O'Clock " string should covered by double quotation( " " ) mark in c language. where a single character should covered by single quotation mmark. for example 'a' 'b'
13th Jul 2022, 3:55 PM
KAZI MD SHAKIB HASSAN
KAZI MD SHAKIB HASSAN - avatar
+ 6
hi everyone is the string… 42 is an integer 5.0 is a float… integers are whole numbers and floats are decimals… You can imagine a string as text, strings always habe quotes around them
6th Jul 2022, 8:16 PM
Janne
Janne - avatar
+ 3
print(type(42)) print(type(5.0)) print(type("hi")) https://www.sololearn.com/learning/1172
7th Jul 2022, 12:28 AM
Korkunç el Gato
Korkunç el Gato - avatar
+ 3
Thanks. I get it now
7th Jul 2022, 8:53 AM
Sayeed Rashed
Sayeed Rashed - avatar
+ 1
42 is an integer without quotations while "42" is a string.
7th Jul 2022, 5:00 AM
ρү૨œdԌ૨ ×
ρү૨œdԌ૨ × - avatar
+ 1
print("42"+"42") will output 4242
7th Jul 2022, 5:01 AM
ρү૨œdԌ૨ ×
ρү૨œdԌ૨ × - avatar