I wrote similar code but getting a different output?

@vipulch the code you attatched is empty