What string? - Overclock.net - An Overclocking Community

Forum Jump: 

What string?

 
Thread Tools
post #1 of 6 (permalink) Old 03-19-2018, 12:18 PM - Thread Starter
New to Overclock.net
 
PhotonFanatic's Avatar
 
Join Date: Dec 2009
Posts: 1,832
Rep: 18 (Unique: 17)
What string?

Where is the string in this? As you can see from the pic, it marked the answer correct. But I see no string here. What am I missing? I did not think that I would get the answer right. That was just my first attempt. Yet it marked it as correct, which is what the green checkmark in the box denotes. Before you do the exorcise, that box is just empty and grey. So I'd like to know how my answer, is in any way related to a string. To me it looks like its got nothing to do with a string.
Attached Thumbnails
Click image for larger version

Name:	stringfloat.PNG
Views:	38
Size:	58.8 KB
ID:	119009  


"Executing execution.exe"
Bang for the buck
(12 items)
CPU
3570k @ 4.6Ghz @1.35v
Motherboard
Gigabyte Z77x UD3H
GPU
evga GTX 970 SSC
RAM
16Gb Gskill Ripjaws 2133Mhz @ 9-11-10-28
Hard Drive
Samsung Evo 850
Power Supply
Silverstone 900 watt
Cooling
Thermalright Ultra 120 Extreme
Case
Silverstone Raven (1st edition)
Operating System
Windows 10 Spy Delux
Monitor
Xstar 27" PLS 1440p
Keyboard
Wireless ergonomic
Mouse
Logisys Wireless trackball
▲ hide details ▲
PhotonFanatic is offline  
Sponsored Links
Advertisement
 
post #2 of 6 (permalink) Old 03-19-2018, 12:47 PM - Thread Starter
New to Overclock.net
 
PhotonFanatic's Avatar
 
Join Date: Dec 2009
Posts: 1,832
Rep: 18 (Unique: 17)
Sorry lol, this is Python 2 language.

"Executing execution.exe"
Bang for the buck
(12 items)
CPU
3570k @ 4.6Ghz @1.35v
Motherboard
Gigabyte Z77x UD3H
GPU
evga GTX 970 SSC
RAM
16Gb Gskill Ripjaws 2133Mhz @ 9-11-10-28
Hard Drive
Samsung Evo 850
Power Supply
Silverstone 900 watt
Cooling
Thermalright Ultra 120 Extreme
Case
Silverstone Raven (1st edition)
Operating System
Windows 10 Spy Delux
Monitor
Xstar 27" PLS 1440p
Keyboard
Wireless ergonomic
Mouse
Logisys Wireless trackball
▲ hide details ▲
PhotonFanatic is offline  
post #3 of 6 (permalink) Old 03-19-2018, 01:19 PM
Overclocker
 
JackCY's Avatar
 
Join Date: Jun 2014
Posts: 9,757
Rep: 330 (Unique: 237)
This is one of the reasons I prefer C/C++ where everything has to be defined and not left open to interpretation.

IMHO it treats float_1 as double, float_2 as double, product as double but Python is Python and it really doesn't care for types so it does it's own conversion of the double product to string without you telling it to.
Maybe this is standardized somewhere but there are many things in Python that depend on the interpreter and who wrote it's libraries, often in C etc.

All in all Python doesn't care about types per se, it's a mishmash of guessing what is what and does conversion on it's own as necessary, as expected or unexpected.

I don't use Python regularly to remember these quirks, it's more of a scripting language for typing up things fast easy lazy that will then run with poor performance if one would create something complex.

Last edited by JackCY; 03-19-2018 at 01:22 PM.
JackCY is offline  
Sponsored Links
Advertisement
 
post #4 of 6 (permalink) Old 03-20-2018, 10:22 AM
New to Overclock.net
 
Mrzev's Avatar
 
Join Date: Feb 2008
Location: Texas
Posts: 2,258
Rep: 96 (Unique: 76)
You can do something like 30.02f to denote a float if you want. I know in Javascript sometimes it gets a bit weird when it autodetects between strings and numbers. mainly when you start combining them.

Code:
var a = "test";
var b = 1;
var c = 3;
var d =5;

a+b+c   = "test13"
a+(b+c) = "test4"
a+b+c*d = "test115"
Lots of little things like that you sometimes gotta watch out for.



Mrzev is offline  
post #5 of 6 (permalink) Old 03-25-2018, 01:17 AM - Thread Starter
New to Overclock.net
 
PhotonFanatic's Avatar
 
Join Date: Dec 2009
Posts: 1,832
Rep: 18 (Unique: 17)
Side question, newb question:

Did you guys find it hard to pass your certificate test? Just curious on that one

"Executing execution.exe"
Bang for the buck
(12 items)
CPU
3570k @ 4.6Ghz @1.35v
Motherboard
Gigabyte Z77x UD3H
GPU
evga GTX 970 SSC
RAM
16Gb Gskill Ripjaws 2133Mhz @ 9-11-10-28
Hard Drive
Samsung Evo 850
Power Supply
Silverstone 900 watt
Cooling
Thermalright Ultra 120 Extreme
Case
Silverstone Raven (1st edition)
Operating System
Windows 10 Spy Delux
Monitor
Xstar 27" PLS 1440p
Keyboard
Wireless ergonomic
Mouse
Logisys Wireless trackball
▲ hide details ▲
PhotonFanatic is offline  
post #6 of 6 (permalink) Old 03-25-2018, 04:35 PM - Thread Starter
New to Overclock.net
 
PhotonFanatic's Avatar
 
Join Date: Dec 2009
Posts: 1,832
Rep: 18 (Unique: 17)
Also, strings are always true if you say == correct?

So this is True:

"Alpha" == "Bravo"

"Executing execution.exe"
Bang for the buck
(12 items)
CPU
3570k @ 4.6Ghz @1.35v
Motherboard
Gigabyte Z77x UD3H
GPU
evga GTX 970 SSC
RAM
16Gb Gskill Ripjaws 2133Mhz @ 9-11-10-28
Hard Drive
Samsung Evo 850
Power Supply
Silverstone 900 watt
Cooling
Thermalright Ultra 120 Extreme
Case
Silverstone Raven (1st edition)
Operating System
Windows 10 Spy Delux
Monitor
Xstar 27" PLS 1440p
Keyboard
Wireless ergonomic
Mouse
Logisys Wireless trackball
▲ hide details ▲
PhotonFanatic is offline  
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the Overclock.net - An Overclocking Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off