forked from Srinivas11789/AlgorithmNuggets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path101_1.py
More file actions
30 lines (25 loc) · 1.04 KB
/
101_1.py
File metadata and controls
30 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
### This is a very simple program that illustrates the difference between raw_input and input
-- Encountered in a Hackerrank problem and took few minutes to figure out
### We already know of the vulnerability that takes in a raw_input which takes an input and also matches with any possible variable name inside python.
### Even then the difference is not spotted so I wanted to make a note here. The input function, takes an input only as the given datatype, you gotta explicity use "" for a string. But for raw_input this is not the case, it would accept any ascii value
"""
z = input()
print z
y = raw_input()
print y
# Declare second integer, double, and String variables.
x=0
y=0.0
z=""
# Read and save an integer, double, and String to your variables.
x = input()
y = input()
z = raw_input()
# Print the sum of both integer variables on a new line.
print(x+i)
# Print the sum of the double variables on a new line.
print(y+d)
# Concatenate and print the String variables on a new line
print(s+z)
# The 's' variable above should be printed first.